home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex / base / classes.dtx (.txt) < prev    next >
LaTeX Document  |  1994-12-17  |  144KB  |  3,776 lines

  1. % \iffalse meta-comment
  2. % Copyright 1994 the LaTeX3 project and the individual authors.
  3. % All rights reserved. For further copyright information see the file
  4. % legal.txt, and any other copyright indicated in this file.
  5. % This file is part of the LaTeX2e system.
  6. % ----------------------------------------
  7. %  This system is distributed in the hope that it will be useful,
  8. %  but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. % IMPORTANT NOTICE:
  11. % For error reports in case of UNCHANGED versions see bugs.txt.
  12. % Please do not request updates from us directly.  Distribution is
  13. % done through Mail-Servers and TeX organizations.
  14. % You are not allowed to change this file.
  15. % You are allowed to distribute this file under the condition that
  16. % it is distributed together with all files mentioned in manifest.txt.
  17. % If you receive only some of these files from someone, complain!
  18. % You are NOT ALLOWED to distribute this file alone.  You are NOT
  19. % ALLOWED to take money for the distribution or use of either this
  20. % file or a changed version, except for a nominal charge for copying
  21. % etc.
  22. % \fi
  23. % \CheckSum{2949}
  24. %% \CharacterTable
  25. %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  26. %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  27. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  28. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  29. %%   Dollar        \$     Percent       \%     Ampersand     \&
  30. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  31. %%   Asterisk      \*     Plus          \+     Comma         \,
  32. %%   Minus         \-     Point         \.     Solidus       \/
  33. %%   Colon         \:     Semicolon     \;     Less than     \<
  34. %%   Equals        \=     Greater than  \>     Question mark \?
  35. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  36. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  37. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  38. %%   Right brace   \}     Tilde         \~}
  39. % \iffalse
  40. % \section{Identification}
  41. %    These document classes can only be used with \LaTeXe, so we make
  42. %    sure that an appropriate message is displayed when another \TeX{}
  43. %    format is used.
  44. %    \begin{macrocode}
  45. %<article|report|book>\NeedsTeXFormat{LaTeX2e}
  46. %    \end{macrocode}
  47. %    Announce the Class name and its version:
  48. %    \begin{macrocode}
  49. %<article>\ProvidesClass{article}
  50. %<report>\ProvidesClass{report}
  51. %<book>\ProvidesClass{book}
  52. %<10pt&!bk>\ProvidesFile{size10.clo}
  53. %<11pt&!bk>\ProvidesFile{size11.clo}
  54. %<12pt&!bk>\ProvidesFile{size12.clo}
  55. %<10pt&bk>\ProvidesFile{bk10.clo}
  56. %<11pt&bk>\ProvidesFile{bk11.clo}
  57. %<12pt&bk>\ProvidesFile{bk12.clo}
  58. %<leqno>\ProvidesFile{leqno.clo}
  59. %<fleqn>\ProvidesFile{fleqn.clo}
  60. %<*driver>
  61. \ProvidesFile{classes.drv}
  62. %</driver>
  63.               [1994/12/09 v1.2x
  64. %<article|report|book> Standard LaTeX document class]
  65. %<10pt|11pt|12pt>      Standard LaTeX file (size option)]
  66. %<leqno>               Standard LaTeX option (left equation numbers)]
  67. %<fleqn>               Standard LaTeX option (flush left equations)]
  68. %    \end{macrocode}
  69. % \fi
  70. % \changes{v1.0j}{1993/12/20}{Added \cmd\ProvidesFile to size files}
  71. % \changes{v1.0l}{1994/01/11}{add the extension to the names of the
  72. %     files} 
  73. % \changes{v1.1a}{1994/03/12}{Removed `typeout messages}
  74. % \changes{v1.1f}{1994/04/15}{Inserted forgotten line break}
  75. % \changes{v1.2i}{1994/04/28}{Use LaTeX instead of LaTeX2e in messages}
  76. % \changes{v1.2j}{1994/05/01}{Removed the use of \cmd\fileversion
  77. %    c.s.}
  78. % \changes{v1.2o}{1994/05/24}{Changed file information}
  79. % \changes{v1.2p}{1994/05/27}{Moved identification and driver to the
  80. %    front of the file}
  81. % \changes{v1.2v}{1994/12/01}{Made the oneside option work for the
  82. %    book class}
  83. % \changes{v1.2w}{1994/12/01}{Use \cs{newcommand*} for commands with
  84. %    arguments}
  85. % \iffalse
  86. % \section{A driver for this document}
  87. % The next bit of code contains the documentation driver file for
  88. % \TeX{}, i.e., the file that will produce the documentation you are
  89. % currently reading. It will be extracted from this file by the 
  90. % {\sc docstrip} program.
  91. % \changes{1.0f}{1993/12/07}{Use class ltxdoc document class}
  92. % \changes{1.0r}{1994/02/28}{Moved driver code in order not to need a
  93. %    separate driver}
  94. %    \begin{macrocode}
  95. %<*driver>
  96. \documentclass{ltxdoc}
  97. %    \end{macrocode}
  98. %    We don't want everything to appear in the index
  99. %    \begin{macrocode}
  100. \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
  101. \DoNotIndex{\@centercr,\@cite}
  102. \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
  103. \DoNotIndex{\@input,\@ixpt,\@m}
  104. \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
  105. \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
  106. \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
  107. \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
  108. \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
  109. \DoNotIndex{\advance,\Alph,\alph}
  110. \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
  111. \DoNotIndex{\bullet}
  112. \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
  113. \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
  114. \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
  115. \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
  116. \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
  117. \DoNotIndex{\fbox}
  118. \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
  119. \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
  120. \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
  121. \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
  122. \DoNotIndex{\input}
  123. \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
  124. \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
  125. \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
  126. \DoNotIndex{\NeedsTeXFormat,\newdimen}
  127. \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
  128. \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
  129. \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
  130. \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
  131. \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
  132. \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
  133. \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
  134. \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
  135. \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
  136. \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
  137. \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
  138. \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
  139. \DoNotIndex{\wd,\xiipt,\year,\z@}
  140. %    \end{macrocode}
  141. %    We do want an index, using linenumbers
  142. %    \begin{macrocode}
  143. \EnableCrossrefs
  144. %    \end{macrocode}
  145. %    We use so many \file{docstrip} modules that we set the
  146. %    \texttt{StandardModuleDepth} counter to 1.
  147. %    \begin{macrocode}
  148. \setcounter{StandardModuleDepth}{1}
  149. %    \end{macrocode}
  150. %    The following command retrieves the date and version information
  151. %    from the file.
  152. %    \begin{macrocode}
  153. \GetFileInfo{classes.drv}
  154. %    \end{macrocode}
  155. %    Some commonly used abbreviations
  156. % \changes{v1.2w}{1994/12/01}{Use \cs{newcommand*}}
  157. %    \begin{macrocode}
  158. \newcommand*{\Lopt}[1]{\textsf {#1}}
  159. \newcommand*{\file}[1]{\texttt {#1}}
  160. \newcommand*{\Lcount}[1]{\textsl {\small#1}}
  161. \newcommand*{\pstyle}[1]{\textsl {#1}}
  162. %    \end{macrocode}
  163. %    We also want the full details.
  164. %    \begin{macrocode}
  165. \begin{document}
  166. \DocInput{classes.dtx}
  167. \PrintIndex
  168. % ^^A\PrintChanges
  169. \end{document}
  170. %</driver>
  171. %    \end{macrocode}
  172. % \fi
  173. % \changes{v1.0d}{1993/11/30}{remove \cmd\@in, made option makeindex a
  174. %                             synonym for option makeidx}
  175. % \changes{v1.0d}{1993/11/30}{removed \cmd\@minus, \cmd\@plus,
  176. %                             \cmd\@settopoint, \cmd\@setfontsize;
  177. %                             they are now in the kernel}
  178. % \changes{v1.0d}{1993/11/30}{Added use of \cmd\NeedsTeXFormat}
  179. % \changes{v1.0d}{1993/11/30}{Replaced \cmd\bf with \cmd\bfseries;
  180. %                             \cmd\rm with \cmd\rmfamily}
  181. % \changes{v1.0d}{1993/11/30}{Made eqaution and eqnarray environments in
  182. %                             the fleqn option up to date with
  183. %                             latex.dtx}
  184. % \changes{v1.0f}{1993/12/08}{Made all lines shorter than 72 characters}
  185. % \changes{v1.0g}{1993/12/08}{Made change in eqnarray for the fleqn
  186. %                             option, as suggested by Rainer.}
  187. % \changes{v1.0h}{1993/12/18}{Made the definitions of the font- and
  188. %    size-changing commands use \cmd\renew rather than \cmd\new.
  189. %    Defined the float parameters with \cmd\renewcommand rather than
  190. %    \cmd\newcommand.  Corrected some typos in the fleqn option.
  191. %    Replaced two occurrences of -\cmd\@secpenalty by
  192. %    \cmd\@secpenalty.  ASAJ.}
  193. % \changes{v1.0j}{1993/12/10}{Use \cmd\cmd in change entries}
  194. % \changes{v1.0k}{1994/01/09}{Removed some typos/bugs}
  195. % \changes{v1.0l}{1994/01/10}{Changed version numbering; moved leqno
  196. %    and fleqn options to an external file.}
  197. % \changes{v1.0n}{1994/01/19}{Removed code for makeidx option and made
  198. %    it a separate package; removed use of \cmd\setlength from list
  199. %    parameters.}
  200. % \changes{v1.0o}{1994/01/31}{Small documention changes}
  201. % \changes{v1.0q}{1994/02/16}{Small documention changes}
  202. % \changes{v1.2a}{1994/03/17}{Added openright option. (LL)}
  203. % \changes{v1.2b}{1994/03/17}{Added the \ldots{}matter commands. (LL)}
  204. % \changes{v1.2c}{1994/03/17}{Fixed page numbering in titlepage
  205. %    env. (LL)}
  206. % \changes{v1.2d}{1994/04/11}{Checked the file for long lines and
  207. %    wrapped them when necessary; made a slight implementation
  208. %    modification to the openright and openany options.}
  209. % \changes{v1.2l}{1994/05/11}{changed some \cmd\changes entries}
  210. % \changes{v1.2m}{1994/05/12}{Forgot a few entries}
  211. % \changes{v1.2t}{1994/06/22}{Refrased a few sentences to prevent
  212. %    overfull hboxes}
  213. % \title{Standard Document Classes for \LaTeX{} version 2e\thanks{This
  214. %        file has version number \fileversion, last revised
  215. %        \filedate.}}
  216. % \author{%
  217. % Copyright (C) 1992 by Leslie Lamport \and
  218. % Copyright (C) 1994-94 by Frank Mittelbach \and Johannes Braams
  219. % \date{\filedate}
  220. % \maketitle
  221. % \tableofcontents
  222. % \StopEventually{}    ^^A 
  223. % \section{The {\sc docstrip} modules}
  224. % The following modules are used in the implementation to direct
  225. % {\sc docstrip} in generating the external files:
  226. % \begin{center}
  227. % \begin{tabular}{ll}
  228. %   article & produce the documentclass article\\
  229. %   report  & produce the documentclass report\\
  230. %   size10  & produce the class option for 10pt\\
  231. %   size11  & produce the class option for 11pt\\
  232. %   size12  & produce the class option for 12pt\\
  233. %   book    & produce the documentclass book\\
  234. %   bk10    & produce the book class option for 10pt\\
  235. %   bk11    & produce the book class option for 11pt\\
  236. %   bk12    & produce the book class option for 12pt\\
  237. %   fleqn   & produce the class option fleqn\\
  238. %   leqno   & produce the class option leqno\\
  239. %   driver  & produce a documentation driver file \\
  240. % \end{tabular}
  241. % \end{center}
  242. % \section{Initial Code}
  243. %    In this part we define a few commands that are used later on.
  244. % \begin{macro}{\@ptsize}
  245. %    This control sequence is used to store the second digit of the
  246. %    pointsize we are typesetting in. So, normally, it's value is one
  247. %    of 0, 1 or 2.
  248. %    \begin{macrocode}
  249. %<*article|report|book>
  250. \newcommand{\@ptsize}{}
  251. %    \end{macrocode}
  252. % \end{macro}
  253. % \begin{macro}{\if@restonecol}
  254. %    When the document has to printed in two columns, we sometimes
  255. %    have to temporarily switch to one column. This switch is used to
  256. %    remember to switch back.
  257. %    \begin{macrocode}
  258. \newif\if@restonecol
  259. %    \end{macrocode}
  260. % \end{macro}
  261. % \begin{macro}{\if@titlepage}
  262. %    A switch to indicate if a titlepage has to be produced.  For the
  263. %    article document class the default is not to make a separate
  264. %    titlepage.
  265. %    \begin{macrocode}
  266. \newif\if@titlepage
  267. %<article>\@titlepagefalse
  268. %<!article>\@titlepagetrue
  269. %    \end{macrocode}
  270. % \end{macro}
  271. % \begin{macro}{\if@openright}
  272. %    A switch to indicate if chapters must start on a right-hand page.
  273. %    The default for the report class is no; for the book class it's
  274. %    yes.
  275. %    \begin{macrocode}
  276. %<!article>\newif\if@openright
  277. %    \end{macrocode}
  278. % \end{macro}
  279. % \begin{macro}{\if@openbib}
  280. %    A switch to indicate if the bibliography has to be produced in
  281. %    the ``open'' format. The default is to use a ``closed'' format.
  282. %    \begin{macrocode}
  283. \newif\if@openbib
  284. \@openbibfalse
  285. %    \end{macrocode}
  286. % \end{macro}
  287. % \begin{macro}{\if@mainmatter}
  288. % \changes{v1.2v}{1994/12/01}{Moved the allocation of
  289. %    \cs{if@mainmatter} here}
  290. %    The switch |\if@mainmatter|, only available in the document class
  291. %    book, indicates whether we are processing the main material in
  292. %    the book.
  293. %    \begin{macrocode}
  294. %<book>\newif\if@mainmatter \@mainmattertrue
  295. %    \end{macrocode}
  296. %  \end{macro}
  297. % \section{Declaration of Options}
  298. % \subsection{Setting Paper Sizes}
  299. %    The variables |\paperwidth| and |\paperheight| should reflect the
  300. %    physical paper size after trimming. For desk printer output this
  301. %    is usually the real paper size since there is no post-processing.
  302. %    Classes for real book production will probably add other paper
  303. %    sizes and additionally the production of crop marks for trimming.
  304. % \changes{v1.0g}{1993/12/09}{Removed typo, A4 is not 279 mm high}
  305. %    \begin{macrocode}
  306. \DeclareOption{a4paper}
  307.    {\setlength\paperheight {297mm}%
  308.     \setlength\paperwidth  {210mm}}
  309. \DeclareOption{a5paper}
  310.    {\setlength\paperheight {210mm}%
  311.     \setlength\paperwidth  {148mm}}
  312. \DeclareOption{b5paper}
  313.    {\setlength\paperheight {250mm}%
  314.     \setlength\paperwidth  {176mm}}
  315. \DeclareOption{letterpaper}
  316.    {\setlength\paperheight {11in}%
  317.     \setlength\paperwidth  {8.5in}}
  318. \DeclareOption{legalpaper}
  319.    {\setlength\paperheight {14in}%
  320.     \setlength\paperwidth  {8.5in}}
  321. \DeclareOption{executivepaper}
  322.    {\setlength\paperheight {10.5in}%
  323.     \setlength\paperwidth  {7.25in}}
  324. %    \end{macrocode}
  325. %    The option \Lopt{landscape} switches the values of |\paperheight|
  326. %    and |\paperwidth|, assuming the dimensions wer given for portrait
  327. %    paper.
  328. %    \begin{macrocode}
  329. \DeclareOption{landscape}
  330.    {\setlength\@tempdima   {\paperheight}%
  331.     \setlength\paperheight {\paperwidth}%
  332.     \setlength\paperwidth  {\@tempdima}}
  333. %    \end{macrocode}
  334. % \subsection{Choosing the type size}
  335. %    The type size options are handled by defining |\@ptsize| to contain
  336. %    the last digit of the size in question and branching on |\ifcase|
  337. %    statements. This is done for historical reasons to stay compatible
  338. %    with other packages that use the |\@ptsize| variable to select
  339. %    special actions. It makes the declarations of size options less
  340. %    than 10pt difficult, although one can probably use \texttt{9}
  341. %    and \texttt{8} assuming that a class wont define both
  342. %    \Lopt{8pt} and \Lopt{18pt} options.
  343. %    \begin{macrocode}
  344. \DeclareOption{10pt}{\renewcommand{\@ptsize}{0}}
  345. \DeclareOption{11pt}{\renewcommand{\@ptsize}{1}}
  346. \DeclareOption{12pt}{\renewcommand{\@ptsize}{2}}
  347. %    \end{macrocode}
  348. %  \subsection{Two-side or one-side printing}
  349. %    For two-sided printing we use the switch |\if@twoside|. In
  350. %    addition we have to set the |\if@mparswitch| to get any margin
  351. %    paragraphs into the outside margin.
  352. %    \begin{macrocode}
  353. \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
  354. \DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}
  355. %    \end{macrocode}
  356. %  \subsection{Draft option}
  357. %    If the user requests \Lopt{draft} we show any overfull boxes.
  358. %    We could probably add some more interesting stuff to this option.
  359. %    \begin{macrocode}
  360. \DeclareOption{draft}{\setlength\overfullrule{5pt}}
  361. \DeclareOption{final}{\setlength\overfullrule{0pt}}
  362. %    \end{macrocode}
  363. %  \subsection{Titlepage option}
  364. %    An article usually has no separate titlepage, but the user can
  365. %    request one.
  366. %    \begin{macrocode}
  367. \DeclareOption{titlepage}{\@titlepagetrue}
  368. \DeclareOption{notitlepage}{\@titlepagefalse}
  369. %    \end{macrocode}
  370. %  \subsection{openright option}
  371. %    This option determines whether or not a chapter must start on
  372. %    a right-hand page 
  373. %    request one.
  374. %    \begin{macrocode}
  375. %<!article>\DeclareOption{openright}{\@openrighttrue}
  376. %<!article>\DeclareOption{openany}{\@openrightfalse}
  377. %    \end{macrocode}
  378. %  \subsection{Twocolumn printing}
  379. %    Two-column and one-column printing is again realized via a switch.
  380. %    \begin{macrocode}
  381. \DeclareOption{onecolumn}{\@twocolumnfalse}
  382. \DeclareOption{twocolumn}{\@twocolumntrue}
  383. %    \end{macrocode}
  384. %  \subsection{Equation numbering on the left}
  385. %    The option \Lopt{leqno} can be used to get the equation numbers
  386. %    on the left side of the equation.
  387. %    \begin{macrocode}
  388. \DeclareOption{leqno}{\input{leqno.clo}}
  389. %    \end{macrocode}
  390. %  \subsection{Flush left displays}
  391. %    The option \Lopt{fleqn} redefines the displayed math environmens
  392. %    in such a way that they come out flush left, with an indentation
  393. %    of |\mathindent| from the prevailing left margin.
  394. % \changes{v1.0h}{1993/12/18}{Corrected some typos.  ASAJ.}
  395. %    \begin{macrocode}
  396. \DeclareOption{fleqn}{\input{fleqn.clo}}
  397. %    \end{macrocode}
  398. % \subsection{Open bibliography}
  399. %    The option \Lopt{openbib} produces the ``open'' bibliography
  400. %    style, in which each block starts on a new line, and succeeding
  401. %    lines in a block are indented by |\bibindent|.
  402. %    \begin{macrocode}
  403. \DeclareOption{openbib}{\@openbibtrue}
  404. %    \end{macrocode}
  405. % \section{Executing Options}
  406. %    Here we execute the default options to initialize certain
  407. %    variables. Note that the document class `book' always uses two
  408. %    sided printing.
  409. %    \begin{macrocode}
  410. %<*article>
  411. \ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final}
  412. %</article>
  413. %<*report>
  414. \ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final,openany}
  415. %</report>
  416. %<*book>
  417. \ExecuteOptions{letterpaper,10pt,twoside,onecolumn,final,openright}
  418. %</book>
  419. %    \end{macrocode}
  420. %    The |\ProcessOptions| command causes the execution of the code
  421. %    for every option \Lopt{FOO}
  422. %    which is declared and for which the user typed
  423. %    the \Lopt{FOO} option in his
  424. %    |\documentclass| command.  For every option \Lopt{BAR} he typed,
  425. %    which is not declared, the option is assumed to be a global option.
  426. %    All options will be passed as document options to any
  427. %    |\usepackage| command in the document preamble.
  428. %    \begin{macrocode}
  429. \ProcessOptions
  430. %    \end{macrocode}
  431. %    Now that all the options have been executed we can load the
  432. %    chosen class option file that contains all size dependent code.
  433. %    \begin{macrocode}
  434. %<!book>\input{size1\@ptsize.clo}
  435. %<book>\input{bk1\@ptsize.clo}
  436. %</article|report|book>
  437. %    \end{macrocode}
  438. %  \section{Loading Packages}
  439. %  The standard class files do not load additional packages.
  440. % \section{Document Layout}
  441. % \label{sec:maincode}
  442. %  In this section we are finally dealing with the nasty typographical
  443. %  details.
  444. % \subsection{Fonts}
  445. %    \LaTeX\ offers the user commands to change the size of the font,
  446. %    relative to the `main' size. Each relative size changing command
  447. %    |\size| executes the command
  448. %    |\@setfontsize||\size|\meta{font-size}\meta{baselineskip} where:
  449. %    \begin{description}
  450. %    \item[\meta{font-size}] The absolute size of the font to use from
  451. %        now on.
  452. %    \item[\meta{baselineskip}] The normal value of |\baselineskip|
  453. %        for the size of the font selected. (The actual value will be
  454. %        |\baselinestretch| * \meta{baselineskip}.)
  455. %    \end{description}
  456. %    A number of commands, defined in the \LaTeX{} kernel, shorten the
  457. %    following  definitions and are used throughout. They are:
  458. % \begin{center}
  459. % \begin{tabular}{ll@{\qquad}ll@{\qquad}ll}
  460. %  \verb=\@vpt= & 5 & \verb=\@vipt= & 6 & \verb=\@viipt= & 7 \\
  461. %  \verb=\@viiipt= & 8 & \verb=\@ixpt= & 9 & \verb=\@xpt= & 10 \\
  462. %  \verb=\@xipt= & 10.95 & \verb=\@xiipt= & 12 & \verb=\@xivpt= & 14.4\\
  463. %  ...
  464. %  \end{tabular}
  465. %  \end{center}
  466. % \begin{macro}{\normalsize}
  467. % \begin{macro}{\@normalsize}
  468. % \changes{v1.0o}{1994/01/31}{`@normalsize now defined in the kernel}
  469. %    The user level command for the main size is |\normalsize|.
  470. %    Internally \LaTeX{} uses |\@normalsize| when it refers to the
  471. %    main size. |\@normalsize| will be defined to work like
  472. %    |\normalsize| if the latter is redefined from its default
  473. %    definition (that just issues an error message). Otherwise
  474. %    |\@normalsize| simply selects a 10pt/12pt size.
  475. %    The |\normalsize| macro also sets new values for\\
  476. %    |\abovedisplayskip|, |\abovedisplayshortskip| and
  477. %    |\belowdisplayshortskip|.
  478. % \changes{v1.0e}{1993/12/07}{\cmd\normalsize doesn't exist, so use
  479. %    \cmd\newcommand}
  480. % \changes{v1.0h}{1993/12/18}{\cmd\normalsize is now defined in the
  481. %    kernel, so use \cmd\renewcommand.  ASAJ.}
  482. %    \begin{macrocode}
  483. %<*10pt|11pt|12pt>
  484. \renewcommand{\normalsize}{%
  485. %<*10pt>
  486.    \@setfontsize\normalsize\@xpt\@xiipt
  487.    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
  488.    \abovedisplayshortskip \z@ \@plus3\p@
  489.    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
  490. %</10pt>
  491. %<*11pt>
  492.    \@setfontsize\normalsize\@xipt{13.6}%
  493.    \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
  494.    \abovedisplayshortskip \z@ \@plus3\p@
  495.    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
  496. %</11pt>
  497. %<*12pt>
  498.    \@setfontsize\normalsize\@xiipt{14.5}%
  499.    \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
  500.    \abovedisplayshortskip \z@ \@plus3\p@
  501.    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
  502. %</12pt>
  503. %    \end{macrocode}
  504. %    The |\belowdisplayskip| is always equal to the
  505. %    |\abovedisplayskip|. The parameters of the first level list are
  506. %    always given by |\@listI|.
  507. %    \begin{macrocode}
  508.    \belowdisplayskip \abovedisplayskip
  509.    \let\@listi\@listI}
  510. %    \end{macrocode}
  511. %    We initially choose the normalsize font.
  512. %    \begin{macrocode}
  513. \normalsize
  514. %    \end{macrocode}
  515. % \end{macro}
  516. % \end{macro}
  517. % \begin{macro}{\small}
  518. %    This is similar to |\normalsize|.
  519. % \changes{v1.0h}{1993/12/18}{\cmd\small is now defined in the kernel,
  520. %    so use \cmd\renewcommand.  ASAJ.}
  521. % \changes{v1.2e}{1994/04/14}{\cmd\small is no longer defined in the
  522. %    kernel; use \cmd\newcommand}
  523. %    \begin{macrocode}
  524. \newcommand{\small}{%
  525. %<*10pt>
  526.    \@setfontsize\small\@ixpt{11}%
  527.    \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
  528.    \abovedisplayshortskip \z@ \@plus2\p@
  529.    \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
  530.    \def\@listi{\leftmargin\leftmargini
  531.                \topsep 4\p@ \@plus2\p@ \@minus2\p@
  532.                \parsep 2\p@ \@plus\p@ \@minus\p@
  533.                \itemsep \parsep}%
  534. %</10pt>
  535. %<*11pt>
  536.    \@setfontsize\small\@xpt\@xiipt
  537.    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
  538.    \abovedisplayshortskip \z@ \@plus3\p@
  539.    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
  540.    \def\@listi{\leftmargin\leftmargini
  541.                \topsep 6\p@ \@plus2\p@ \@minus2\p@
  542.                \parsep 3\p@ \@plus2\p@ \@minus\p@
  543.                \itemsep \parsep}%
  544. %</11pt>
  545. %<*12pt>
  546.    \@setfontsize\small\@xipt{13.6}%
  547.    \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
  548.    \abovedisplayshortskip \z@ \@plus3\p@
  549.    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
  550.    \def\@listi{\leftmargin\leftmargini
  551.                \topsep 9\p@ \@plus3\p@ \@minus5\p@
  552.                \parsep 4.5\p@ \@plus2\p@ \@minus\p@
  553.                \itemsep \parsep}%
  554. %</12pt>
  555.    \belowdisplayskip \abovedisplayskip
  556. %    \end{macrocode}
  557. % \end{macro}
  558. % \begin{macro}{\footnotesize}
  559. %    This is similar to |\normalsize|.
  560. % \changes{v1.0h}{1993/12/18}{\cmd\footnotesize is now defined in the
  561. %    kernel, so use \cmd\renewcommand.  ASAJ.}
  562. % \changes{v1.2e}{1994/04/14}{use \cmd\newcommand again}
  563. %    \begin{macrocode}
  564. \newcommand{\footnotesize}{%
  565. %<*10pt>
  566.    \@setfontsize\footnotesize\@viiipt{9.5}%
  567.    \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
  568.    \abovedisplayshortskip \z@ \@plus\p@
  569.    \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
  570.    \def\@listi{\leftmargin\leftmargini
  571.                \topsep 3\p@ \@plus\p@ \@minus\p@
  572.                \parsep 2\p@ \@plus\p@ \@minus\p@
  573.                \itemsep \parsep}%
  574. %</10pt>
  575. %<*11pt>
  576.    \@setfontsize\footnotesize\@ixpt{11}%
  577.    \abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@
  578.    \abovedisplayshortskip \z@ \@plus\p@
  579.    \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
  580.    \def\@listi{\leftmargin\leftmargini
  581.                \topsep 4\p@ \@plus2\p@ \@minus2\p@
  582.                \parsep 2\p@ \@plus\p@ \@minus\p@
  583.                \itemsep \parsep}%
  584. %</11pt>
  585. %<*12pt>
  586.    \@setfontsize\footnotesize\@xpt\@xiipt
  587.    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
  588.    \abovedisplayshortskip \z@ \@plus3\p@
  589.    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
  590.    \def\@listi{\leftmargin\leftmargini
  591.                \topsep 6\p@ \@plus2\p@ \@minus2\p@
  592.                \parsep 3\p@ \@plus2\p@ \@minus\p@
  593.                \itemsep \parsep}%
  594. %</12pt>
  595.    \belowdisplayskip \abovedisplayskip
  596. %</10pt|11pt|12pt>
  597. %    \end{macrocode}
  598. % \end{macro}
  599. % \begin{macro}{\scriptsize}
  600. % \begin{macro}{\tiny}
  601. % \begin{macro}{\large}
  602. % \begin{macro}{\Large}
  603. % \begin{macro}{\LARGE}
  604. % \begin{macro}{\huge}
  605. % \begin{macro}{\Huge}
  606. %    These are all much simpler than the previous macros, they just
  607. %    select a new fontsize, but leave the parameters for displays and
  608. %    lists alone.
  609. % \changes{v1.0h}{1993/12/18}{These are now defined in the kernel,
  610. %    so use \cmd\renewcommand.  ASAJ.}
  611. % \changes{v1.2e}{1994/04/14}{use \cmd\newcommand again}
  612. %    \begin{macrocode}
  613. %<*10pt>
  614. \newcommand{\scriptsize}{\@setfontsize\scriptsize\@viipt\@viiipt}
  615. \newcommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt}
  616. \newcommand{\large}{\@setfontsize\large\@xiipt{14}}
  617. \newcommand{\Large}{\@setfontsize\Large\@xivpt{18}}
  618. \newcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{22}}
  619. \newcommand{\huge}{\@setfontsize\huge\@xxpt{25}}
  620. \newcommand{\Huge}{\@setfontsize\Huge\@xxvpt{30}}
  621. %</10pt>
  622. %<*11pt>
  623. \newcommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}}
  624. \newcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
  625. \newcommand{\large}{\@setfontsize\large\@xiipt{14}}
  626. \newcommand{\Large}{\@setfontsize\Large\@xivpt{18}}
  627. \newcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{22}}
  628. \newcommand{\huge}{\@setfontsize\huge\@xxpt{25}}
  629. \newcommand{\Huge}{\@setfontsize\Huge\@xxvpt{30}}
  630. %</11pt>
  631. %<*12pt>
  632. \newcommand{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}}
  633. \newcommand{\tiny}{\@setfontsize\tiny\@vipt\@viipt}
  634. \newcommand{\large}{\@setfontsize\large\@xivpt{18}}
  635. \newcommand{\Large}{\@setfontsize\Large\@xviipt{22}}
  636. \newcommand{\LARGE}{\@setfontsize\LARGE\@xxpt{25}}
  637. \newcommand{\huge}{\@setfontsize\huge\@xxvpt{30}}
  638. \let\Huge=\huge
  639. %</12pt>
  640. %    \end{macrocode}
  641. % \end{macro}
  642. % \end{macro}
  643. % \end{macro}
  644. % \end{macro}
  645. % \end{macro}
  646. % \end{macro}
  647. % \end{macro}
  648. % \subsection{Paragraphing}
  649. % \begin{macro}{\lineskip}
  650. % \begin{macro}{\normallineskip}
  651. %    These parameters control \TeX's behaviour when two lines tend to
  652. %    come too close together.
  653. %    \begin{macrocode}
  654. %<*article|report|book>
  655. \setlength\lineskip{1\p@}
  656. \setlength\normallineskip{1\p@}
  657. %    \end{macrocode}
  658. % \end{macro}
  659. % \end{macro}
  660. % \begin{macro}{\baselinestretch}
  661. %    This is used as a multiplier for |\baselineskip|. The default is
  662. %    to {\em not\/} stretch the baselines.
  663. %    \begin{macrocode}
  664. \renewcommand{\baselinestretch}{}
  665. %    \end{macrocode}
  666. % \end{macro}
  667. % \begin{macro}{\parskip}
  668. % \begin{macro}{\parindent}
  669. %    |\parskip| gives extra vertical space between paragraphs and
  670. %    |\parindent| is the width of the paragraph indentation. The value
  671. %    of |\parindent| depends on whether we are in two column mode.
  672. % \changes{v1.0m}{1994/01//12}{\cmd\parindent should be different,
  673. %                             depending on the pointsize}
  674. %    \begin{macrocode}
  675. \setlength\parskip{0\p@ \@plus \p@}
  676. %</article|report|book>
  677. %<*10pt|11pt|12pt>
  678. \if@twocolumn
  679.   \setlength\parindent{1em}
  680. \else
  681. %<10pt>  \setlength\parindent{15\p@}
  682. %<11pt>  \setlength\parindent{17\p@}
  683. %<12pt>  \setlength\parindent{1.5em}
  684. %</10pt|11pt|12pt>
  685. %    \end{macrocode}
  686. % \end{macro}
  687. % \end{macro}
  688. % \begin{macro}{\@lowpenalty}
  689. % \begin{macro}{\@medpenalty}
  690. % \begin{macro}{\@highpenalty}%
  691. %    The commands |\nopagebreak| and |\nolinebreak| put in penalties
  692. %    to discourage these breaks at the point they are put in.
  693. %    They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|,
  694. %    dependent on their argument.
  695. %    \begin{macrocode}
  696. %<*article|report|book>
  697. \@lowpenalty   51
  698. \@medpenalty  151
  699. \@highpenalty 301
  700. %    \end{macrocode}
  701. % \end{macro}
  702. % \end{macro}
  703. % \end{macro}
  704. % \begin{macro}{\clubpenalty}
  705. % \begin{macro}{\widowpenalty}
  706. %    These penalties are use to discourrage club and widow lines.
  707. %    Because we use their default values we only show them here,
  708. %    commented out.
  709. %    \begin{macrocode}
  710. % \clubpenalty  150
  711. % \widowpenalty 150
  712. %    \end{macrocode}
  713. % \end{macro}
  714. % \end{macro}
  715. % \begin{macro}{\displaywidowpenalty}
  716. % \begin{macro}{\predisplaypenalty}
  717. % \begin{macro}{\postdisplaypenalty}
  718. %    Discourrage (but not so much) widows in front of a math display
  719. %    and forbid breaking directly in front of a display. Allow break
  720. %    after a display without a penalty. Again the default values are
  721. %    used, therefore we only show them here.
  722. %    \begin{macrocode}
  723. % \displaywidowpenalty 50
  724. % \predisplaypenalty   10000
  725. % \postdisplaypenalty  0
  726. %    \end{macrocode}
  727. % \end{macro}
  728. % \end{macro}
  729. % \end{macro}
  730. % \begin{macro}{\interlinepenalty}
  731. %    Allow the breaking of a page in the middle of a paragraph.
  732. %    \begin{macrocode}
  733. % \interlinepenalty 0
  734. %    \end{macrocode}
  735. % \end{macro}
  736. % \begin{macro}{\brokenpenalty}
  737. %    We allow the breaking of a page after a hyphenated line.
  738. % \changes{v1.1a}{1994/03/12}{Show correct default which is 100}
  739. %    \begin{macrocode}
  740. % \brokenpenalty 100
  741. %</article|report|book>
  742. %    \end{macrocode}
  743. % \end{macro}
  744. % \subsection{Page Layout}
  745. %    All margin dimensions are measured from a point one inch from the
  746. %    top and lefthand side of the page.
  747. % \subsubsection{Vertical spacing}
  748. % \begin{macro}{\headheight}
  749. % \begin{macro}{\headsep}
  750. % \begin{macro}{\topskip}
  751. %    The |\headheight| is the height of the box that will contain the
  752. %    running head. The |\headsep| is the distance between the bottom
  753. %    of the running head and the top of the text. The |\topskip| is the
  754. %    |\baselineskip| for the first line on a page; 
  755. %    \LaTeX's output routine will not work properly if it has the
  756. %    value 0pt, so do not do that!
  757. %    \begin{macrocode}
  758. %<*10pt|11pt|12pt>
  759. \setlength\headheight{12\p@}
  760. %<!bk>\setlength\headsep   {25\p@}
  761. %<10pt&bk>\setlength\headsep   {.25in}
  762. %<11pt&bk>\setlength\headsep   {.275in}
  763. %<12pt&bk>\setlength\headsep   {.275in}
  764. %<10pt>\setlength\topskip   {10\p@}
  765. %<11pt>\setlength\topskip   {11\p@}
  766. %<12pt>\setlength\topskip   {12\p@}
  767. %    \end{macrocode}
  768. % \end{macro}
  769. % \end{macro}
  770. % \end{macro}
  771. % \begin{macro}{\footskip}
  772. %    The distance from the baseline of the box which contains the
  773. %    running footer to the baseline of last line of text is controlled
  774. %    by the |\footskip|.
  775. %    \begin{macrocode}
  776. %<!bk>\setlength\footskip{30\p@}
  777. %<10pt&bk>\setlength\footskip{.35in}
  778. %<11pt&bk>\setlength\footskip{.38in}
  779. %<12pt&bk>\setlength\footskip{30\p@}
  780. %    \end{macrocode}
  781. % \end{macro}
  782. % \begin{macro}{\maxdepth}
  783. % \begin{macro}{\@maxdepth}
  784. % \changes{v1.2k}{1994/05/06}{Added setting of \cmd\maxdepth and
  785. %    \cmd\@maxdepth}
  786. %    The \TeX\ primitive register |\maxdepth| has a function that is
  787. %    similar to that of |\topskip|. The register |\@maxdepth| should
  788. %    always contain a copy of |\maxdepth|. In both plain \TeX\ and
  789. %    \LaTeX~2.09 |\maxdepth| had a fixed value of \texttt{4pt}; in
  790. %    native \LaTeX2e\ mode we let the value depend on the typesize. We
  791. %    set it so that |\maxdepth| $+$ |\topskip| $=$ typesize $\times
  792. %    1.5$. As it happens, in these classes |\topskip| is equal to the
  793. %    typesize, therefor we set |\maxdepth| to half the value of
  794. %    |\topskip|.
  795. %    \begin{macrocode}
  796. \if@compatibility \setlength\maxdepth{4\p@} \else
  797. \setlength\maxdepth{.5\topskip} \fi
  798. \setlength\@maxdepth\maxdepth
  799. %    \end{macrocode}
  800. % \end{macro}
  801. % \end{macro}
  802. % \subsubsection{The dimension of text}
  803. % \begin{macro}{\textwidth}
  804. %    When we are in compatibility mode we have to make sure that the
  805. %    dimensions of the printed area are not different from what the
  806. %    user was used to see.
  807. %    \begin{macrocode}
  808. \if@compatibility
  809.   \if@twocolumn
  810.     \setlength\textwidth{410\p@}
  811.   \else
  812. %<10pt&!bk>    \setlength\textwidth{345\p@}
  813. %<11pt&!bk>    \setlength\textwidth{360\p@}
  814. %<12pt&!bk>    \setlength\textwidth{390\p@}
  815. %<10pt&bk>    \setlength\textwidth{4.5in}
  816. %<11pt&bk>    \setlength\textwidth{5in}
  817. %<12pt&bk>    \setlength\textwidth{5in}
  818.   \fi
  819. %    \end{macrocode}
  820. %    When we are not in compatibility mode we can set some of the
  821. %    dimensions differently, taking into account the paper size for
  822. %    instance.
  823. %    \begin{macrocode}
  824. \else
  825. %    \end{macrocode}
  826. %    First, we calculate the maximum |\textwidth|, which we will allow
  827. %    on the selected paper and store it in |\@tempdima|. Then we store
  828. %    the length of a line with approximately 60--70 characters in
  829. %    |\@tempdimb|. The values given are more or less suitable when
  830. %    Computer Modern fonts are used.
  831. % \changes{v1.1a}{1994/03/12}{Have old values for width in native mode}
  832. %    \begin{macrocode}
  833.   \setlength\@tempdima{\paperwidth}
  834.   \addtolength\@tempdima{-2in}
  835. %<10pt>  \setlength\@tempdimb{345\p@}
  836. %<11pt>  \setlength\@tempdimb{360\p@}
  837. %<12pt>  \setlength\@tempdimb{390\p@}
  838. %    \end{macrocode}
  839. %    Now we can set the |\textwidth|, depending on whether we will be
  840. %    setting one or two columns.
  841. %    In two column mode each {\em column} shouldn't be wider than
  842. %    |\@tempdimb| (which could happen on \textsc{a3} paper for
  843. %    instance).
  844. %    \begin{macrocode}
  845.   \if@twocolumn
  846.     \ifdim\@tempdima>2\@tempdimb\relax
  847.       \setlength\textwidth{2\@tempdimb}
  848.     \else
  849.       \setlength\textwidth{\@tempdima}
  850.     \fi
  851. %    \end{macrocode}
  852. %    In one column mode the text should not be wider than the minimum
  853. %    of the paperwidth (minus 2 inches for the margins) and the
  854. %    maximum length of a line as defined by the number of characters.
  855. %    \begin{macrocode}
  856.   \else
  857.     \ifdim\@tempdima>\@tempdimb\relax
  858.       \setlength\textwidth{\@tempdimb}
  859.     \else
  860.       \setlength\textwidth{\@tempdima}
  861.     \fi
  862.   \fi
  863. %    \end{macrocode}
  864. %    Here we modify the width of the text a little to be a whole
  865. %    number of points.
  866. %    \begin{macrocode}
  867. \if@compatibility\else
  868.   \@settopoint\textwidth
  869. %    \end{macrocode}
  870. % \end{macro}
  871. % \begin{macro}{\textheight}
  872. %    Now that we have computed the width of the text, we have to take
  873. %    care of the height. The |\textheight| is the height of text
  874. %    (including footnotes and figures, excluding running head and
  875. %    foot).
  876. %    First make sure that the compatibility mode gets the same
  877. %    dimensions as we had with \LaTeX2.09. The number of lines was
  878. %    calculated as the floor of the old |\textheight| minus
  879. %    |\topskip|, divided by |\baselineskip| for |\normalsize|. The
  880. %    old value of |\textheight| was 528pt.
  881. %    \begin{macrocode}
  882. \if@compatibility
  883. %<10pt&!bk>  \setlength\textheight{43\baselineskip}
  884. %<10pt&bk>  \setlength\textheight{41\baselineskip}
  885. %<11pt>  \setlength\textheight{38\baselineskip}
  886. %<12pt>  \setlength\textheight{36\baselineskip}
  887. %    \end{macrocode}
  888. %    Again we compute this, depending on the papersize and depending
  889. %    on the baselineskip that is used, in order to have a whole number
  890. %    of lines on the page.
  891. %    \begin{macrocode}
  892. \else
  893.   \setlength\@tempdima{\paperheight}
  894. %    \end{macrocode}
  895. %    We leave at least a 1 inch margin on the top and the bottom of
  896. %    the page.
  897. %    \begin{macrocode}
  898.   \addtolength\@tempdima{-2in}
  899. %    \end{macrocode}
  900. %    We also have to leave room for the running headers and footers.
  901. %    \begin{macrocode}
  902.   \addtolength\@tempdima{-1.5in}
  903. %    \end{macrocode}
  904. %    Then we divide the result by the current |\baselineskip| and
  905. %    store this in the count register |\@tempcnta|, which then
  906. %    contains the number of lines that fit on this page.
  907. %    \begin{macrocode}
  908.   \divide\@tempdima\baselineskip
  909.   \@tempcnta=\@tempdima
  910. %    \end{macrocode}
  911. %    From this we can calculate the height of the text.
  912. %    \begin{macrocode}
  913.   \setlength\textheight{\@tempcnta\baselineskip}
  914. %    \end{macrocode}
  915. %    The first line on the page has a height of |\topskip|.
  916. %    \begin{macrocode}
  917. \addtolength\textheight{\topskip}
  918. %    \end{macrocode}
  919. % \end{macro}
  920. % \subsubsection{Margins}
  921. % \begin{macro}{\oddsidemargin}
  922. % \begin{macro}{\evensidemargin}
  923. % \begin{macro}{\marginparwidth}
  924. %    First we give the values for the compatibility mode.
  925. %    Values for two-sided printing:
  926. %    \begin{macrocode}
  927. \if@compatibility
  928. %<*bk>
  929. %<10pt>   \setlength\oddsidemargin   {.5in}
  930. %<11pt>   \setlength\oddsidemargin   {.25in}
  931. %<12pt>   \setlength\oddsidemargin   {.25in}
  932. %<10pt>   \setlength\evensidemargin  {1.5in}
  933. %<11pt>   \setlength\evensidemargin  {1.25in}
  934. %<12pt>   \setlength\evensidemargin  {1.25in}
  935. %<10pt>   \setlength\marginparwidth {.75in}
  936. %<11pt>   \setlength\marginparwidth {1in}
  937. %<12pt>   \setlength\marginparwidth {1in}
  938. %</bk>
  939. %<*!bk>
  940.   \if@twoside
  941. %<10pt>     \setlength\oddsidemargin   {44\p@}
  942. %<11pt>     \setlength\oddsidemargin   {36\p@}
  943. %<12pt>     \setlength\oddsidemargin   {21\p@}
  944. %<10pt>     \setlength\evensidemargin  {82\p@}
  945. %<11pt>     \setlength\evensidemargin  {74\p@}
  946. %<12pt>     \setlength\evensidemargin  {59\p@}
  947. %<10pt>     \setlength\marginparwidth {107\p@}
  948. %<11pt>     \setlength\marginparwidth {100\p@}
  949. %<12pt>     \setlength\marginparwidth {85\p@}
  950. %    \end{macrocode}
  951. %    Values for one-sided printing:
  952. %    \begin{macrocode}
  953.   \else
  954. %<10pt>     \setlength\oddsidemargin   {63\p@}
  955. %<11pt>     \setlength\oddsidemargin   {54\p@}
  956. %<12pt>     \setlength\oddsidemargin   {39.5\p@}
  957. %<10pt>     \setlength\evensidemargin  {63\p@}
  958. %<11pt>     \setlength\evensidemargin  {54\p@}
  959. %<12pt>     \setlength\evensidemargin  {39.5\p@}
  960. %<10pt>     \setlength\marginparwidth  {90\p@}
  961. %<11pt>     \setlength\marginparwidth  {83\p@}
  962. %<12pt>     \setlength\marginparwidth  {68\p@}
  963.   \fi
  964. %</!bk>
  965. %    \end{macrocode}
  966. %    And values for two column mode:
  967. %    \begin{macrocode}
  968.   \if@twocolumn
  969.      \setlength\oddsidemargin  {30\p@}
  970.      \setlength\evensidemargin {30\p@}
  971.      \setlength\marginparwidth {48\p@}
  972.   \fi
  973. %    \end{macrocode}
  974. %    When we are not in compatibility mode we can take the dimensions
  975. %    of the selected paper into account.
  976. %    The values for |\oddsidemargin| and |\marginparwidth| will be set
  977. %    depending on the status of the |\if@twoside|.
  978. %    If |@twoside| is true (which is always the case for book) we make
  979. %    the inner margin smaller than the outer one.
  980. %    \begin{macrocode}
  981. \else
  982.   \if@twoside
  983.     \setlength\@tempdima        {\paperwidth}
  984.     \addtolength\@tempdima      {-\textwidth}
  985.     \setlength\oddsidemargin    {.4\@tempdima}
  986.     \addtolength\oddsidemargin  {-1in}
  987. %    \end{macrocode}
  988. %    The width of the margin for text is set to the remainder of the
  989. %    width except for a `real margin' of white space of width 0.4in.
  990. %    A check should perhaps be built in to ensure that the (text)
  991. %    margin width does not get too small!
  992. %    
  993. % \changes{v1.1a}{1994/03/12}{New algorithm for `oddsidemargin}
  994. % \changes{v1.1a}{1994/03/12}{New algorithm for `marginparwidth}
  995. %    \begin{macrocode}
  996.     \setlength\marginparwidth   {.6\@tempdima}
  997.     \addtolength\marginparwidth {-0.4in}
  998. %    \end{macrocode}
  999. %    For one-sided printing we center the text on the page, by
  1000. %    calculating the difference between |\textwidth| and
  1001. %    |\paperwidth|. Half of that difference is than used for
  1002. %    the margin (thus |\oddsidemargin| is |1in| less). 
  1003. %    \begin{macrocode}
  1004.   \else
  1005.     \setlength\@tempdima        {\paperwidth}
  1006.     \addtolength\@tempdima      {-\textwidth}
  1007.     \setlength\oddsidemargin    {.5\@tempdima}
  1008.     \addtolength\oddsidemargin  {-1in}
  1009.     \setlength\marginparwidth   {.5\@tempdima}
  1010.     \addtolength\marginparwidth {-.4in}
  1011.   \fi
  1012. %    \end{macrocode}
  1013. %    With the above algorithm the |\marginparwidth| can come out quite
  1014. %    large which we may not want.
  1015. %    \begin{macrocode}
  1016.   \ifdim \marginparwidth >2in
  1017.      \setlength\marginparwidth{2in}
  1018.   \fi
  1019. %    \end{macrocode}
  1020. %    Having done these calculation we make them pt values.
  1021. %    \begin{macrocode}
  1022.   \@settopoint\oddsidemargin
  1023.   \@settopoint\marginparwidth
  1024. %    \end{macrocode}
  1025. %    The |\evensidemargin| can now be computed from the values set
  1026. %    above.
  1027. % \changes{v1.0l}{1994/01//11}{Computing of \cmd\evensidemargin should
  1028. %                             only occur in compatibility mode}
  1029. %    \begin{macrocode}
  1030.   \setlength\evensidemargin  {\paperwidth}
  1031.   \addtolength\evensidemargin{-2in}
  1032.   \addtolength\evensidemargin{-\textwidth}
  1033.   \addtolength\evensidemargin{-\oddsidemargin}
  1034. %    \end{macrocode}
  1035. %    Setting |\evensidemargin| to a full point value may produce a
  1036. %    small error. However it will lie within the error range a
  1037. %    doublesided printer of todays technology can accuratly print.
  1038. %    \begin{macrocode}
  1039.   \@settopoint\evensidemargin
  1040. %    \end{macrocode}
  1041. % \end{macro}
  1042. % \end{macro}
  1043. % \end{macro}
  1044. % \begin{macro}{\marginparsep}
  1045. % \begin{macro}{\marginparpush}
  1046. %    The horizontal space between the main text and marginal notes is
  1047. %    determined by |\marginparsep|, the minimum vertical separation
  1048. %    between two marginal notes is controlled by |\marginparpush|.
  1049. %    \begin{macrocode}
  1050. \if@twocolumn
  1051.  \setlength\marginparsep {10\p@}
  1052. \else
  1053. %<10pt&!bk>  \setlength\marginparsep{11\p@}
  1054. %<11pt&!bk>  \setlength\marginparsep{10\p@}
  1055. %<12pt&!bk>  \setlength\marginparsep{10\p@}
  1056. %<bk>  \setlength\marginparsep{7\p@}
  1057. %<10pt|11pt>\setlength\marginparpush{5\p@}
  1058. %<12pt>\setlength\marginparpush{7\p@}
  1059. %    \end{macrocode}
  1060. % \end{macro}
  1061. % \end{macro}
  1062. % \begin{macro}{\topmargin}
  1063. %    The |\topmargin| is the distance between the top of `the
  1064. %    printable area' --which is 1 inch below the top of the paper--
  1065. %    and the top of the box which contains the running head.
  1066. %    It can now be computed from the values set above.
  1067. %    \begin{macrocode}
  1068. \if@compatibility
  1069. %<!bk>  \setlength\topmargin{27pt}
  1070. %<10pt&bk>  \setlength\topmargin{.75in}
  1071. %<11pt&bk>  \setlength\topmargin{.73in}
  1072. %<12pt&bk>  \setlength\topmargin{.73in}
  1073. \else
  1074.   \setlength\topmargin{\paperheight}
  1075.   \addtolength\topmargin{-2in}
  1076.   \addtolength\topmargin{-\headheight}
  1077.   \addtolength\topmargin{-\headsep}
  1078.   \addtolength\topmargin{-\textheight}
  1079.   \addtolength\topmargin{-\footskip}     % this might be wrong!
  1080. %    \end{macrocode}
  1081. %    By changing the factor in the next line the complete page
  1082. %    can be shifted vertically.
  1083. % \changes{v1.2u}{1994/07/13}{Moved rounding of \cs{topmargin} to
  1084. %    native mode}
  1085. %    \begin{macrocode}
  1086.   \addtolength\topmargin{-.5\topmargin}
  1087.   \@settopoint\topmargin
  1088. %    \end{macrocode}
  1089. % \end{macro}
  1090. % \subsubsection{Footnotes}
  1091. % \begin{macro}{\footnotesep}
  1092. %    |\footnotesep| is the height of the strut placed at the beginning
  1093. %    of every footnote. It equals the  height of a normal
  1094. %    |\footnotesize| strut in this
  1095. %    class, thus no extra space occurs between footnotes.
  1096. %    \begin{macrocode}
  1097. %<10pt>\setlength\footnotesep{6.65\p@}
  1098. %<11pt>\setlength\footnotesep{7.7\p@}
  1099. %<12pt>\setlength\footnotesep{8.4\p@}
  1100. %    \end{macrocode}
  1101. % \end{macro}
  1102. % \begin{macro}{\footins}
  1103. %    |\skip\footins| is the space between the last line of the main
  1104. %    text and the top of the first footnote.
  1105. %    \begin{macrocode}
  1106. %<10pt>\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}
  1107. %<11pt>\setlength{\skip\footins}{10\p@ \@plus 4\p@ \@minus 2\p@}
  1108. %<12pt>\setlength{\skip\footins}{10.8\p@ \@plus 4\p@ \@minus 2\p@}
  1109. %</10pt|11pt|12pt>
  1110. %    \end{macrocode}
  1111. % \end{macro}
  1112. % \subsubsection{Float placement parameters}
  1113. % All float parameters are given default values in the \LaTeXe{}
  1114. % kernel. For this reason counters only need to be set with
  1115. % |\setcounter| and other parameters are set using |\renewcommand|.
  1116. % \paragraph{Limits for the placement of floating objects}
  1117. % \begin{macro}{\c@topnumber}
  1118. %    The \Lcount{topnumber} counter holds the maximum number of
  1119. %    floats that can appear on the top of a text page.
  1120. %    \begin{macrocode}
  1121. %<*article|report|book>
  1122. \setcounter{topnumber}{2}
  1123. %    \end{macrocode}
  1124. % \end{macro}
  1125. % \begin{macro}{\topfraction}
  1126. %    This indicates the maximum part of a text page that can be
  1127. %    occupied by floats at the top.
  1128. % \changes{v1.0h}{1993/12/18}{Replaced \cmd\newcommand with
  1129. %    \cmd\renewcommand.  ASAJ.}
  1130. %    \begin{macrocode}
  1131. \renewcommand{\topfraction}{.7}
  1132. %    \end{macrocode}
  1133. % \end{macro}
  1134. % \begin{macro}{\c@bottomnumber}
  1135. %    The \Lcount{bottomnumber} counter holds the maximum number of
  1136. %    floats that can appear on the bottom of a text page.
  1137. %    \begin{macrocode}
  1138. \setcounter{bottomnumber}{1}
  1139. %    \end{macrocode}
  1140. % \end{macro}
  1141. % \begin{macro}{\bottomfraction}
  1142. %    This indicates the maximum part of a text page that can be
  1143. %    occupied by floats at the bottom.
  1144. % \changes{v1.0h}{1993/12/18}{Replaced \cmd\newcommand with
  1145. %    \cmd\renewcommand.  ASAJ.}
  1146. %    \begin{macrocode}
  1147. \renewcommand{\bottomfraction}{.3}
  1148. %    \end{macrocode}
  1149. % \end{macro}
  1150. % \begin{macro}{\c@totalnumber}
  1151. %    This indicates the maximum number of floats that can appear on
  1152. %    any text page.
  1153. %    \begin{macrocode}
  1154. \setcounter{totalnumber}{3}
  1155. %    \end{macrocode}
  1156. % \end{macro}
  1157. % \begin{macro}{\textfraction}
  1158. %    This indicates the minimum part of a text page that has to be
  1159. %    occupied by text.
  1160. % \changes{v1.0h}{1993/12/18}{Replaced \cmd\newcommand with
  1161. %    \cmd\renewcommand.  ASAJ.}
  1162. %    \begin{macrocode}
  1163. \renewcommand{\textfraction}{.2}
  1164. %    \end{macrocode}
  1165. % \end{macro}
  1166. % \begin{macro}{\floatpagefraction}
  1167. %    This indicates the minimum part of a page that has to be
  1168. %    occupied by floating objects before a `float page' is produced.
  1169. % \changes{v1.0h}{1993/12/18}{Replaced \cmd\newcommand with
  1170. %    \cmd\renewcommand.  ASAJ.}
  1171. %    \begin{macrocode}
  1172. \renewcommand{\floatpagefraction}{.5}
  1173. %    \end{macrocode}
  1174. % \end{macro}
  1175. % \begin{macro}{\c@dbltopnumber}
  1176. %    The \Lcount{dbltopnumber} counter holds the maximum number of
  1177. %    two column floats that can appear on the top of a two column text
  1178. %    page.
  1179. %    \begin{macrocode}
  1180. \setcounter{dbltopnumber}{2}
  1181. %    \end{macrocode}
  1182. % \end{macro}
  1183. % \begin{macro}{\dbltopfraction}
  1184. %    This indicates the maximum part of a two column text page that
  1185. %    can be occupied by two column floats at the top.
  1186. % \changes{v1.0h}{1993/12/18}{Replaced \cmd\newcommand with
  1187. %    \cmd\renewcommand.  ASAJ.}
  1188. %    \begin{macrocode}
  1189. \renewcommand{\dbltopfraction}{.7}
  1190. %    \end{macrocode}
  1191. % \end{macro}
  1192. % \begin{macro}{\dblfloatpagefraction}
  1193. %    This indicates the minimum part of a page that has to be
  1194. %    occupied by two column wide floating objects before a `float
  1195. %    page' is produced.
  1196. % \changes{v1.0h}{1993/12/18}{Replaced \cmd\newcommand with
  1197. %    \cmd\renewcommand.  ASAJ.}
  1198. %    \begin{macrocode}
  1199. \renewcommand{\dblfloatpagefraction}{.5}
  1200. %</article|report|book>
  1201. %    \end{macrocode}
  1202. % \end{macro}
  1203. % \paragraph{Floats on a text page}
  1204. % \begin{macro}{\floatsep}
  1205. % \begin{macro}{\textfloatsep}
  1206. % \begin{macro}{\intextsep}
  1207. %    When a floating object is placed on a page with text, these
  1208. %    parameters control the separation between the float and the other
  1209. %    objects on the page. These parameters are used for both
  1210. %    one-column mode and single-column floats in two-column mode.
  1211. %    |\floatsep| is the space between adjacent floats that are moved
  1212. %    to the top or bottom of the text page.
  1213. %    |\textfloatsep| is the space between the main text and floats
  1214. %    at the top or bottom of the page.
  1215. %    |\intextsep| is the space between in-text floats and the text.
  1216. %    \begin{macrocode}
  1217. %<*10pt>
  1218. \setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
  1219. \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
  1220. \setlength\intextsep   {12\p@ \@plus 2\p@ \@minus 2\p@}
  1221. %</10pt>
  1222. %<*11pt>
  1223. \setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
  1224. \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
  1225. \setlength\intextsep   {12\p@ \@plus 2\p@ \@minus 2\p@}
  1226. %</11pt>
  1227. %<*12pt>
  1228. \setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 4\p@}
  1229. \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
  1230. \setlength\intextsep   {14\p@ \@plus 4\p@ \@minus 4\p@}
  1231. %</12pt>
  1232. %    \end{macrocode}
  1233. % \end{macro}
  1234. % \end{macro}
  1235. % \end{macro}
  1236. % \begin{macro}{\dblfloatsep}
  1237. % \begin{macro}{\dbltextfloatsep}
  1238. %    When floating objects that span the whole |\textwidth| are placed
  1239. %    on a text page when we are in twocolumn mode the separation
  1240. %    between the float and the text is controlled by |\dblfloatsep|
  1241. %    and |\dbltextfloatsep|.
  1242. %    |\dblfloatsep| is the space between adjacent floats that are moved
  1243. %    to the top or bottom of the text page.
  1244. %    |\dbltextfloatsep| is the space between the main text and floats
  1245. %    at the top or bottom of the page.
  1246. %    \begin{macrocode}
  1247. %<*10pt>
  1248. \setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
  1249. \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
  1250. %</10pt>
  1251. %<*11pt>
  1252. \setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}
  1253. \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
  1254. %</11pt>
  1255. %<*12pt>
  1256. \setlength\dblfloatsep    {14\p@ \@plus 2\p@ \@minus 4\p@}
  1257. \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
  1258. %</12pt>
  1259. %    \end{macrocode}
  1260. % \end{macro}
  1261. % \end{macro}
  1262. % \paragraph{Floats on their own page or column}
  1263. % \begin{macro}{\@fptop}
  1264. % \begin{macro}{\@fpsep}
  1265. % \begin{macro}{\@fpbot}
  1266. %    When floating objects are placed on separate pages the layout of
  1267. %    such pages is controlled by these parameters. At the top of the
  1268. %    page |\@fptop| amount of stretchable whitespace is inserted, at
  1269. %    the bottom of the page we get an |\@fpbot| amount of stretchable
  1270. %    whitespace. Between adjacent floats the |\@fpsep| is inserted.
  1271. %    These parameters are used for the placement of floating objects
  1272. %    in one column mode, or in single column floats in two column
  1273. %    mode.
  1274. %    Note that at least one of the two parameters |\@fptop| and
  1275. %    |\@fpbot| should contain a |plus ...fil| to allow filling the
  1276. %    remaining empty space.
  1277. %    \begin{macrocode}
  1278. %<*10pt>
  1279. \setlength\@fptop{0\p@ \@plus 1fil}
  1280. \setlength\@fpsep{8\p@ \@plus 2fil}
  1281. \setlength\@fpbot{0\p@ \@plus 1fil}
  1282. %</10pt>
  1283. %<*11pt>
  1284. \setlength\@fptop{0\p@ \@plus 1fil}
  1285. \setlength\@fpsep{8\p@ \@plus 2fil}
  1286. \setlength\@fpbot{0\p@ \@plus 1fil}
  1287. %</11pt>
  1288. %<*12pt>
  1289. \setlength\@fptop{0\p@ \@plus 1fil}
  1290. \setlength\@fpsep{10\p@ \@plus 2fil}
  1291. \setlength\@fpbot{0\p@ \@plus 1fil}
  1292. %</12pt>
  1293. %    \end{macrocode}
  1294. % \end{macro}
  1295. % \end{macro}
  1296. % \end{macro}
  1297. % \begin{macro}{\@dblfptop}
  1298. % \begin{macro}{\@dblfpsep}
  1299. % \begin{macro}{\@dblfpbot}
  1300. %    Double column floats in two column mode are handled with similar
  1301. %    parameters.
  1302. %    \begin{macrocode}
  1303. %<*10pt>
  1304. \setlength\@dblfptop{0\p@ \@plus 1fil}
  1305. \setlength\@dblfpsep{8\p@ \@plus 2fil}
  1306. \setlength\@dblfpbot{0\p@ \@plus 1fil}
  1307. %</10pt>
  1308. %<*11pt>
  1309. \setlength\@dblfptop{0\p@ \@plus 1fil}
  1310. \setlength\@dblfpsep{8\p@ \@plus 2fil}
  1311. \setlength\@dblfpbot{0\p@ \@plus 1fil}
  1312. %</11pt>
  1313. %<*12pt>
  1314. \setlength\@dblfptop{0\p@ \@plus 1fil}
  1315. \setlength\@dblfpsep{10\p@ \@plus 2fil}
  1316. \setlength\@dblfpbot{0\p@ \@plus 1fil}
  1317. %</12pt>
  1318. %<*article|report|book>
  1319. %    \end{macrocode}
  1320. % \end{macro}
  1321. % \end{macro}
  1322. % \end{macro}
  1323. % \subsection{Page Styles}
  1324. %    The page style \pstyle{foo} is defined by defining the command
  1325. %    |\ps@foo|.   This command should make only local definitions.
  1326. %    There should be no stray spaces in the definition, since they
  1327. %    could lead to mysterious extra spaces in the output (well, that's
  1328. %    something that should be always avoided).
  1329. % \begin{macro}{\@evenhead}
  1330. % \begin{macro}{\@oddhead}
  1331. % \begin{macro}{\@evenfoot}
  1332. % \begin{macro}{\@oddfoot}
  1333. %    The |\ps@...| command defines the macros |\@oddhead|,
  1334. %    |\@oddfoot|, |\@evenhead|, and |\@evenfoot| to define the running
  1335. %    heads and feet---e.g., |\@oddhead| is the macro to produce the
  1336. %    contents of the heading box for odd-numbered pages.  It is called
  1337. %    inside an |\hbox| of width |\textwidth|.
  1338. % \end{macro}
  1339. % \end{macro}
  1340. % \end{macro}
  1341. % \end{macro}
  1342. % \subsubsection{Marking conventions}
  1343. %    To make headings determined by the sectioning commands, the page
  1344. %    style defines the commands |\chaptermark|, |\sectionmark|,
  1345. %    \ldots,\\
  1346. %     where |\chaptermark{|\meta{TEXT}|}| is called by
  1347. %    |\chapter| to set a mark, and so on.
  1348. %    The |\...mark| commands and the |\...head| macros are defined
  1349. %    with the help of the following macros.  (All the |\...mark|
  1350. %    commands should be initialized to no-ops.)
  1351. %    \LaTeX{} extends \TeX's |\mark| facility by producing two kinds
  1352. %    of marks, a `left' and a `right' mark, using the following
  1353. %    commands:
  1354. %    \begin{flushleft}
  1355. %     |\markboth{|\meta{LEFT}|}{|\meta{RIGHT}|}|: Adds both marks.
  1356. %     |\markright{|\meta{RIGHT}|}|: Adds a `right' mark.
  1357. %     |\leftmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead|
  1358. %                  or |\@evenfoot| macros, it gets the current `left'
  1359. %                  mark.  |\leftmark| works like \TeX's |\botmark|
  1360. %                  command.
  1361. %     |\rightmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead|
  1362. %                   or  |\@evenfoot| macros, it gets the current
  1363. %                   `right' mark. |\rightmark| works like \TeX's
  1364. %                   |\firstmark| command.
  1365. %    \end{flushleft}
  1366. %    The marking commands work reasonably well for right marks
  1367. %    `numbered within' left marks--e.g., the left mark is changed by a
  1368. %    |\chapter| command and the right mark is changed by a |\section|
  1369. %    command.  However, it does produce somewhat anomalous results if
  1370. %    two |\markboth|'s occur on the same page.
  1371. %    Commands like |\tableofcontents| that should set the marks in some
  1372. %    page styles use a |\@mkboth| command, which is |\let| by the
  1373. %    pagestyle command (|\ps@...|)  to |\markboth| for setting the
  1374. %    heading or to |\@gobbletwo| to do nothing.
  1375. %    \begin{macrocode}
  1376. % %%%\mark{{}{}}   % Initializes TeX's marks   <--- can vanish
  1377. %    \end{macrocode}
  1378. % \subsubsection{Defining the page styles}
  1379. % \label{sec:pagestyle}
  1380. %    The pagestyles \pstyle{empty} and \pstyle{plain} are defined in
  1381. %    \file{latex.dtx}.
  1382. % \begin{macro}{\ps@headings}
  1383. %    The definition of the page style \pstyle{headings} has to be
  1384. %    different for two sided printing than it is for one sided
  1385. %    printing.
  1386. %    \begin{macrocode}
  1387. \if@twoside
  1388.   \def\ps@headings{%
  1389. %    \end{macrocode}
  1390. %    The running feet are empty in this page style, the running head
  1391. %    contains the page number and one of the marks.
  1392. %    \begin{macrocode}
  1393.       \let\@oddfoot\@empty\let\@evenfoot\@empty
  1394.       \def\@evenhead{\thepage\hfil\slshape\leftmark}%
  1395.       \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
  1396. %    \end{macrocode}
  1397. %    When using this page style, the contents of the running head is
  1398. %    determined by the chapter and section titles. So we |\let|
  1399. %    |\@mkboth| to |\markboth|.
  1400. %    \begin{macrocode}
  1401.       \let\@mkboth\markboth
  1402. %    \end{macrocode}
  1403. %    For the article document class we define |\sectionmark| to clear
  1404. %    the right mark and put the number of the section (when it is
  1405. %    numbered) and its title in the left mark. The rightmark is set by
  1406. %    |\subsectionmark| to contain the subsection titles.
  1407. %    Note the use of |##1| for the parameter of the |\sectionmark|
  1408. %    command, which will be defined when |\ps@headings| is executed.
  1409. %    \begin{macrocode}
  1410. %<*article>
  1411.     \def\sectionmark##1{%
  1412.       \markboth {\uppercase{%
  1413.         \ifnum \c@secnumdepth >\z@
  1414.           \thesection.\hskip 1em\relax
  1415.         \fi
  1416.         ##1}}{}}%
  1417.     \def\subsectionmark##1{%
  1418.       \markright {%
  1419.         \ifnum \c@secnumdepth >\@ne
  1420.           \thesubsection\hskip 1em\relax
  1421.           \fi
  1422.           ##1}}}
  1423. %</article>
  1424. %    \end{macrocode}
  1425. %    In the report and book document classes we use the |\chaptermark|
  1426. %    and |\sectionmark| macros to fill the running heads.
  1427. %    Note the use of |##1| for the parameter of the |\chaptermark|
  1428. %    command, which will be defined when |\ps@headings| is executed.
  1429. %    \begin{macrocode}
  1430. %<*report|book>
  1431.     \def\chaptermark##1{%
  1432.       \markboth {\uppercase{%
  1433.         \ifnum \c@secnumdepth >\m@ne
  1434. %<book>          \if@mainmatter
  1435.             \@chapapp\ \thechapter. \ %
  1436. %<book>          \fi
  1437.         \fi
  1438.         ##1}}{}}%
  1439.     \def\sectionmark##1{%
  1440.       \markright {\uppercase{%
  1441.         \ifnum \c@secnumdepth >\z@
  1442.           \thesection. \ %
  1443.         \fi
  1444.         ##1}}}}
  1445. %</report|book>
  1446. %    \end{macrocode}
  1447. %    The definition of |\ps@headings| for one sided printing can be
  1448. %    much simpler, because we treat even and odd pages the same.
  1449. %    Therefore we don't need to define |\@even...|.
  1450. %    \begin{macrocode}
  1451. \else
  1452.   \def\ps@headings{%
  1453.     \let\@oddfoot\@empty
  1454.     \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
  1455.     \let\@mkboth\markboth
  1456. %    \end{macrocode}
  1457. %    We use |\markright| now instead of |\markboth| as we did for two
  1458. %    sided printing.
  1459. %    \begin{macrocode}
  1460. %<*article>
  1461.     \def\sectionmark##1{%
  1462.       \markright {\uppercase{%
  1463.         \ifnum \c@secnumdepth >\m@ne
  1464.           \thesection\hskip 1em\relax
  1465.         \fi
  1466.         ##1}}}}
  1467. %</article>
  1468. %    \end{macrocode}
  1469. %    \begin{macrocode}
  1470. %<*report|book>
  1471.     \def\chaptermark##1{%
  1472.       \markright {\uppercase{%
  1473.         \ifnum \c@secnumdepth >\m@ne
  1474. %<book>          \if@mainmatter
  1475.             \@chapapp\ \thechapter. \ %
  1476. %<book>          \fi
  1477.         \fi
  1478.         ##1}}}}
  1479. %</report|book>
  1480. %    \end{macrocode}
  1481. % \end{macro}
  1482. % \begin{macro}{\ps@myheadings}
  1483. %    The definition of the page style \pstyle{myheadings} is fairly
  1484. %    simple because the user determines the contents of the running
  1485. %    head himself by using the |\markboth| and |\markright| commands.
  1486. %    \begin{macrocode}
  1487. \def\ps@myheadings{%
  1488.     \let\@oddfoot\@empty\let\@evenfoot\@empty
  1489.     \def\@evenhead{\thepage\hfil\slshape\leftmark}%
  1490.     \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
  1491. %    \end{macrocode}
  1492. %    We have to make sure that the marking commands that are used by
  1493. %    the chapter and section headings are disabled. We do this
  1494. %    |\let|ting them to a macro that gobbles its argument(s).
  1495. %    \begin{macrocode}
  1496.     \let\@mkboth\@gobbletwo
  1497. %<!article>    \let\chaptermark\@gobble
  1498.     \let\sectionmark\@gobble
  1499. %<article>    \let\subsectionmark\@gobble
  1500.     }
  1501. %    \end{macrocode}
  1502. % \end{macro}
  1503. % \section{Document Markup}
  1504. % \subsection{The title}
  1505. % \begin{macro}{\title}
  1506. % \begin{macro}{\author}
  1507. % \begin{macro}{\date}
  1508. %    These three macros are provided by \file{latex.dtx} to provide
  1509. %    information about the title, author(s) and date of the document.
  1510. %    The information is stored away in internal control sequences.
  1511. %    It is the task of the |\maketitle| command to use the
  1512. %    information provided. The definitions of these macros are shown
  1513. %    here for information.
  1514. %    \begin{macrocode}
  1515. % \newcommand*{\title}[1]{\gdef\@title{#1}}
  1516. % \newcommand*{\author}[1]{\gdef\@author{#1}}
  1517. % \newcommand*{\date}[1]{\gdef\@date{#1}}
  1518. %    \end{macrocode}
  1519. %    The |\date| macro gets today's date by default.
  1520. %    \begin{macrocode}
  1521. % \date{\today}
  1522. %    \end{macrocode}
  1523. % \end{macro}
  1524. % \end{macro}
  1525. % \end{macro}
  1526. % \begin{macro}{\maketitle}
  1527. %    The definition of |\maketitle| depends on whether a separate
  1528. %    title page is made. This is the default for the report and book
  1529. %    document classes, but for the article class it is optional.
  1530. %    When we are making a title page, we locally redefine
  1531. %    |\footnotesize| and |footnoterule| to change the appearance of
  1532. %    the footnotes that are produced by the |\thanks| command.
  1533. %    \begin{macrocode}
  1534. \if@titlepage
  1535.   \newcommand{\maketitle}{\begin{titlepage}%
  1536.   \let\footnotesize\small
  1537.   \let\footnoterule\relax
  1538. %    \end{macrocode}
  1539. %    We center the entire title vertically; the centering is set off a
  1540. %    little by adding a |\vskip|. (In compatibility mode the pagenumber
  1541. %    is set to 0 by the titlepage environment to keep the behaviour 
  1542. %    of \LaTeX\ 2.09 style files.)
  1543. % \changes{v1.0g}{1993/12/09}{Removed the setting of the page number,
  1544. %                            when not in compatibility mode}
  1545. % \changes{v1.2c}{1994/03/17}{Removed setting of page number, now 
  1546. %                            done in titlepage environment}
  1547. %    \begin{macrocode}
  1548.   \null\vfil
  1549.   \vskip 60\p@
  1550. %    \end{macrocode}
  1551. %    Then we set the title, in a |\LARGE| font; leave a little space
  1552. %    and set the author(s) in a |\large| font. We do this inside a
  1553. %    tabular environment to get them in a single column.
  1554. %    Before the date we leave a little whitespace again.
  1555. %    \begin{macrocode}
  1556.   \begin{center}%
  1557.     {\LARGE \@title \par}%
  1558.     \vskip 3em%
  1559.     {\large
  1560.      \lineskip .75em%
  1561.       \begin{tabular}[t]{c}%
  1562.         \@author
  1563.       \end{tabular}\par}%
  1564.       \vskip 1.5em%
  1565.     {\large \@date \par}%       % Set date in \large size.
  1566.   \end{center}\par
  1567. %    \end{macrocode}
  1568. %    Then we call |\@thanks| to print the information that goes into
  1569. %    the footnote and finish the page.
  1570. %    \begin{macrocode}
  1571.   \@thanks
  1572.   \vfil\null
  1573.   \end{titlepage}%
  1574. %    \end{macrocode}
  1575. %    We reset the \Lcount{footnote} counter, disable |\thanks| and
  1576. %    |\maketitle| and save some storage space by emptying the internal
  1577. %    information macros.
  1578. %    \begin{macrocode}
  1579.   \setcounter{footnote}{0}%
  1580.   \let\thanks\relax\let\maketitle\relax
  1581.   \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
  1582. %    \end{macrocode}
  1583. %    When the title is not on a page of its own, the layout of the
  1584. %    title is a little different. We use symbols to mark the footnotes
  1585. %    and we have to deal with two column documents.
  1586. %    Therefore we first start a new group to keep changes local. Then
  1587. %    we redefine |\thefootnote| to use |\fnsymbol|; and change
  1588. %    |\@makefnmark| so that footnotemarks have zero width (to make the
  1589. %    centering of the author names look better).
  1590. % \changes{v1.2s}{1994/06/02}{Reset \cs{@makefntext}}
  1591. %    \begin{macrocode}
  1592. \else
  1593. \newcommand{\maketitle}{\par
  1594.   \begingroup
  1595.     \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  1596.     \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}%
  1597.     \long\def\@makefntext##1{\parindent 1em\noindent
  1598.             \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}%
  1599. %    \end{macrocode}
  1600. %    If this is a twocolumn document we start a new page in twocolumn
  1601. %    mode, with the title set to the full width of the text. The
  1602. %    actual printing of the title information is left to
  1603. %    |\@maketitle|.
  1604. % \changes{v1.2k}{1994/05/06}{Added check on number of columns in use
  1605. %    locally}
  1606. %    \begin{macrocode}
  1607.     \if@twocolumn
  1608.       \ifnum \col@number=\@ne
  1609.         \@maketitle
  1610.       \else
  1611.         \twocolumn[\@maketitle]%
  1612.       \fi
  1613.     \else
  1614. %    \end{macrocode}
  1615. %    When this is not a twocolumn document we just start a new page,
  1616. %    prevent floating objects from appearing on the top of this page
  1617. %    and print the title information.
  1618. %    \begin{macrocode}
  1619.       \newpage
  1620.       \global\@topnum\z@   % Prevents figures from going at top of page.
  1621.       \@maketitle
  1622.     \fi
  1623. %    \end{macrocode}
  1624. %    This page gets a \pstyle{plain} layout. We call |\@thanks| to
  1625. %    produce the footnotes.
  1626. %    \begin{macrocode}
  1627.     \thispagestyle{plain}\@thanks
  1628. %    \end{macrocode}
  1629. %    Now we can close the group, reset the \Lcount{footnote} counter,
  1630. %    disable |\thanks|, |\maketitle| and |\@maketitle| and save some
  1631. %    storage space by emptying the internal information macros.
  1632. %    \begin{macrocode}
  1633.   \endgroup
  1634.   \setcounter{footnote}{0}%
  1635.   \let\thanks\relax
  1636.   \let\maketitle\relax\let\@maketitle\relax
  1637.   \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
  1638. %    \end{macrocode}
  1639. % \end{macro}
  1640. % \begin{macro}{\@maketitle}
  1641. %    This macro takes care of formatting the title information when we
  1642. %    have no separate title page.
  1643. %    We always start a new page, leave some white space and center the
  1644. %    information. The title is set in a |\LARGE| font, the author
  1645. %    names and the in a |\large| font.
  1646. %    \begin{macrocode}
  1647. \def\@maketitle{%
  1648.   \newpage
  1649.   \null
  1650.   \vskip 2em%
  1651.   \begin{center}%
  1652.     {\LARGE \@title \par}%
  1653.     \vskip 1.5em%
  1654.     {\large
  1655.       \lineskip .5em%
  1656.       \begin{tabular}[t]{c}%
  1657.         \@author
  1658.       \end{tabular}\par}%
  1659.     \vskip 1em%
  1660.     {\large \@date}%
  1661.   \end{center}%
  1662.   \par
  1663.   \vskip 1.5em}
  1664. %    \end{macrocode}
  1665. % \end{macro}
  1666. % \subsection{Chapters and Sections}
  1667. % \subsubsection{Building blocks} The definitions in this part of the
  1668. %    class file make use of two internal macros, |\@startsection| and
  1669. %    |\secdef|. To understand
  1670. %    what is going on here, we describe their syntax.
  1671. %    The macro |\@startsection| has 6 required arguments, optionally
  1672. %    followed by  a $*$, an optional argument and a required argument:
  1673. %    |\@startsection|\meta{name}\meta{level}\meta{indent}^^A
  1674. %                    \meta{beforeskip}\meta{afterskip}\meta{style}
  1675. %            optional *\\
  1676. %    \null\hphantom{\bslash @startsection}^^A
  1677. %            |[|\meta{altheading}|]|\meta{heading}
  1678. %    It is a generic command to start a section, the arguments have
  1679. %    the following meaning:
  1680. %    \begin{description}
  1681. %    \item[\meta{name}] The name of the user level command, e.g.,
  1682. %          `section'.
  1683. %    \item[\meta{level}] A number, denoting the depth of the section
  1684. %          -- e.g., chapter=1, section = 2, etc.  A section number
  1685. %          will be printed if and only if \meta{level} $<=$  the value
  1686. %          of the \Lcount{secnumdepth} counter.
  1687. %    \item[\meta{indent}] The indentation of the heading from the left
  1688. %          margin
  1689. %    \item[\meta{beforeskip}] The absolute value of this argument
  1690. %          gives the skip to leave above the heading. If it is
  1691. %          negative, then the paragraph indent of the text following
  1692. %          the heading is suppressed.
  1693. %    \item[\meta{afterskip}] If positive, this gives the skip to leave
  1694. %          below the heading, else it gives the skip to leave to the
  1695. %          right of a run-in heading.
  1696. %    \item[\meta{style}] Commands to set the style of the heading.
  1697. %    \item[$*$] When this is missing the heading is numbered and the
  1698. %          corresponding counter is incremented.
  1699. %    \item[\meta{altheading}] Gives an alternative heading to use in
  1700. %          the table of contents and in the running heads. This should
  1701. %          be present when the $*$ form is used.
  1702. %    \item[\meta{heading}] The heading of the new section.
  1703. %    \end{description}
  1704. %  A sectioning command is normally defined to |\@startsection| and
  1705. %  its first six arguments.
  1706. %    The macro |\secdef| can be used when a sectioning command is
  1707. %    defined without using |\@startsection|. It has two arguments:
  1708. %    |\secdef|\meta{unstarcmds}\meta{starcmds}
  1709. %    \begin{description}
  1710. %    \item[\meta{unstarcmds}] Used for the normal form of the
  1711. %          sectioning command.
  1712. %    \item[\meta{starcmds}] Used for the $*$-form of the
  1713. %          sectioning command.
  1714. %    \end{description}
  1715. %    You can use |\secdef| as follows:
  1716. % \begin{verbatim}
  1717. %       \def\chapter { ... \secdef \CMDA \CMDB }
  1718. %       \def\CMDA    [#1]#2{ ... }  % Command to define
  1719. %                                   % \chapter[...]{...}
  1720. %       \def\CMDB    #1{ ... }      % Command to define
  1721. %                                   % \chapter*{...}
  1722. % \end{verbatim}
  1723. % \subsubsection{Mark commands}
  1724. % \begin{macro}{\chaptermark}
  1725. % \begin{macro}{\sectionmark}
  1726. % \begin{macro}{\subsectionmark}
  1727. % \begin{macro}{\subsubsectionmark}
  1728. % \begin{macro}{\paragraphmark}
  1729. % \begin{macro}{\subparagraphmark}
  1730. %    Default initializations of |\...mark| commands.  These commands
  1731. %    are used in the definition of the page styles (see
  1732. %    section~\ref{sec:pagestyle}) Most of them are already defined by
  1733. %    \file{latex.dtx}, so they are only shown here.
  1734. %    \begin{macrocode}
  1735. %<!article>\newcommand*{\chaptermark}[1]{}
  1736. % \newcommand*{\sectionmark}[1]{}
  1737. % \newcommand*{\subsectionmark}[1]{}
  1738. % \newcommand*{\subsubsectionmark}[1]{}
  1739. % \newcommand*{\paragraphmark}[1]{}
  1740. % \newcommand*{\subparagraphmark}[1]{}
  1741. %    \end{macrocode}
  1742. % \end{macro}
  1743. % \end{macro}
  1744. % \end{macro}
  1745. % \end{macro}
  1746. % \end{macro}
  1747. % \end{macro}
  1748. % \subsubsection{Define Counters}
  1749. % \begin{macro}{\c@secnumdepth}
  1750. %    The value of the counter \Lcount{secnumdepth} gives the depth of
  1751. %    the highest-level sectioning command that is to produce section
  1752. %    numbers.
  1753. %    \begin{macrocode}
  1754. %<article>\setcounter{secnumdepth}{3}
  1755. %<!article>\setcounter{secnumdepth}{2}
  1756. %    \end{macrocode}
  1757. % \end{macro}
  1758. % \begin{macro}{\c@part}
  1759. % \begin{macro}{\c@chapter}
  1760. % \begin{macro}{\c@section}
  1761. % \begin{macro}{\c@subsection}
  1762. % \begin{macro}{\c@subsubsection}
  1763. % \begin{macro}{\c@paragraph}
  1764. % \begin{macro}{\c@subparagraph}
  1765. %    These counters are used for the section numbers. The macro\\
  1766. %    |\newcounter{|\meta{newctr}|}[|\meta{oldctr}|]|\\
  1767. %     defines\meta{newctr} to be a counter, which is reset to zero when
  1768. %    counter \meta{oldctr} is stepped. Counter \meta{oldctr} must
  1769. %    already be defined.
  1770. %    \begin{macrocode}
  1771. \newcounter {part}
  1772. %<article>\newcounter {section}
  1773. %<*report|book>
  1774. \newcounter {chapter}
  1775. \newcounter {section}[chapter]
  1776. %</report|book>
  1777. \newcounter {subsection}[section]
  1778. \newcounter {subsubsection}[subsection]
  1779. \newcounter {paragraph}[subsubsection]
  1780. \newcounter {subparagraph}[paragraph]
  1781. %    \end{macrocode}
  1782. % \end{macro}
  1783. % \end{macro}
  1784. % \end{macro}
  1785. % \end{macro}
  1786. % \end{macro}
  1787. % \end{macro}
  1788. % \end{macro}
  1789. % \begin{macro}{\thepart}
  1790. % \begin{macro}{\thechapter}
  1791. % \begin{macro}{\thesection}
  1792. % \begin{macro}{\thesubsection}
  1793. % \begin{macro}{\thesubsubsection}
  1794. % \begin{macro}{\theparagraph}
  1795. % \begin{macro}{\thesubparagraph}
  1796. %    For any counter \Lcount{CTR}, |\theCTR| is a macro that defines
  1797. %    the printed version of counter \Lcount{CTR}.  It is defined in
  1798. %    terms of the following macros:
  1799. %    |\arabic{|\Lcount{COUNTER}|}| prints the value of
  1800. %    \Lcount{COUNTER} as an arabic numeral.
  1801. %    |\roman{|\Lcount{COUNTER}|}| prints the value of
  1802. %    \Lcount{COUNTER} as a lowercase roman numberal.
  1803. %    |\Roman{|\Lcount{COUNTER}|}| prints the value of
  1804. %    \Lcount{COUNTER} as an uppercase roman numberal.
  1805. %    |\alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER}
  1806. %    as a lowercase letter: $1 =$~a, $2 =$~ b, etc.
  1807. %    |\Alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER}
  1808. %    as an uppercase letter: $1 =$~A, $2 =$~B, etc.
  1809. %    \begin{macrocode}
  1810. \renewcommand{\thepart}         {\Roman{part}}
  1811. %<article>\renewcommand{\thesection}      {\arabic{section}}
  1812. %<*report|book>
  1813. \renewcommand{\thechapter}      {\arabic{chapter}}
  1814. \renewcommand{\thesection}      {\thechapter.\arabic{section}}
  1815. %</report|book>
  1816. \renewcommand{\thesubsection}   {\thesection.\arabic{subsection}}
  1817. \renewcommand{\thesubsubsection}{\thesubsection .\arabic{subsubsection}}
  1818. \renewcommand{\theparagraph}    {\thesubsubsection.\arabic{paragraph}}
  1819. \renewcommand{\thesubparagraph} {\theparagraph.\arabic{subparagraph}}
  1820. %    \end{macrocode}
  1821. % \end{macro}
  1822. % \end{macro}
  1823. % \end{macro}
  1824. % \end{macro}
  1825. % \end{macro}
  1826. % \end{macro}
  1827. % \end{macro}
  1828. % \begin{macro}{\@chapapp}
  1829. %    |\@chapapp| is initially defined to be `|\chaptername|'. The
  1830. %    |\appendix| command redefines it to be `|\appendixname|'.
  1831. %    \begin{macrocode}
  1832. %<report|book>\newcommand{\@chapapp}{\chaptername}
  1833. %    \end{macrocode}
  1834. % \end{macro}
  1835. %  \subsubsection{Front Matter, Main Matter, and Back Matter}
  1836. %    A book contains these three (logical) sections. The switch
  1837. %    |\@mainmatter| is true iff we are processing Main Matter.  When
  1838. %    this switch is false, the |\chapter| command does not print
  1839. %    chapter numbers.
  1840. %    Here we define the commands that start these sections.
  1841. %  \begin{macro}{\frontmatter}
  1842. %    This command starts Roman page numbering and turns off chapter
  1843. %    numbering.
  1844. %    \begin{macrocode}
  1845. %<*book>
  1846. \newcommand{\frontmatter}{\cleardoublepage
  1847.             \@mainmatterfalse\pagenumbering{roman}}
  1848. %    \end{macrocode}
  1849. %  \end{macro}
  1850. %  \begin{macro}{\mainmatter}
  1851. %    This command clears the page, starts arabic page numbering and 
  1852. %    turns on chapter numbering.
  1853. %    \begin{macrocode}
  1854. \newcommand{\mainmatter}{\cleardoublepage
  1855.        \@mainmattertrue\pagenumbering{arabic}}
  1856. %    \end{macrocode}
  1857. %  \end{macro}
  1858. %  \begin{macro}{\backmatter}
  1859. %    This clears the page, turns off chapter numbering and leaves page 
  1860. %    numbering unchanged.
  1861. %    \begin{macrocode}
  1862. \newcommand{\backmatter}{\if@openright\cleardoublepage\else\clearpage\fi
  1863.       \@mainmatterfalse}
  1864. %</book>
  1865. %    \end{macrocode}
  1866. %  \end{macro}
  1867. % \subsubsection{Parts}
  1868. % \begin{macro}{\part}
  1869. %    The command to start a new part of our document.
  1870. %    In the article class the definition of |\part| is rather simple;
  1871. %    we start a new paragraph, add a little white space, suppress the
  1872. %    indentation of the first paragraph and make use of |\secdef|.
  1873. %    \begin{macrocode}
  1874. %<*article>
  1875. \newcommand{\part}{\par
  1876.    \addvspace{4ex}%
  1877.    \@afterindentfalse
  1878.    \secdef\@part\@spart}
  1879. %</article>
  1880. %    \end{macrocode}
  1881. %    For the report and book classes we things a bit different.
  1882. %    We start a new (righthand) page and use the \pstyle{plain}.
  1883. %    \begin{macrocode}
  1884. %<*report|book>
  1885. \newcommand{\part}{\cleardoublepage
  1886.                  \thispagestyle{plain}%
  1887. %    \end{macrocode}
  1888. %    When we are making a two column document, this will be a one
  1889. %    column page. We use |@tempswa| to remember to switch back to two
  1890. %    columns.
  1891. %    \begin{macrocode}
  1892.                  \if@twocolumn
  1893.                      \onecolumn
  1894.                      \@tempswatrue
  1895.                    \else
  1896.                      \@tempswafalse
  1897.                  \fi
  1898. %    \end{macrocode}
  1899. %    We need an empty box to prevent the fil glue from disappearing.
  1900. %    \begin{macrocode}
  1901.                  \hbox{}\vfil
  1902. %    \end{macrocode}
  1903. %    Here we use |\secdef| to indicate wwhich commands to use to make
  1904. %    the actual heading.
  1905. %    \begin{macrocode}
  1906.                  \secdef\@part\@spart}
  1907. %</report|book>
  1908. %    \end{macrocode}
  1909. % \begin{macro}{\@part}
  1910. %    This macro does the actual formatting of the title of the part.
  1911. %    Again the macro is differently defined for the article document
  1912. %    class than for the document classes report and book.
  1913. %    When \Lcount{secnumdepth} is larger than $-1$ for the
  1914. %    document class article, we have a numbered
  1915. %    part, otherwise it is unnumbered.
  1916. %    \begin{macrocode}
  1917. %<*article>
  1918. \def\@part[#1]#2{%
  1919.     \ifnum \c@secnumdepth >\m@ne
  1920.       \refstepcounter{part}%
  1921.       \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
  1922.     \else
  1923.       \addcontentsline{toc}{part}{#1}%
  1924.     \fi
  1925. %    \end{macrocode}
  1926. %    We  print the title flush left in the article class.
  1927. %    Also we prevent breaking between lines and reset the font.
  1928. %    \begin{macrocode}
  1929.     {\parindent \z@ \raggedright
  1930.      \interlinepenalty \@M
  1931.      \reset@font
  1932. %    \end{macrocode}
  1933. %    When this is a numbered part we have to print the number and the
  1934. %    title. The |\nobreak| should prevent a page break here.
  1935. %    \begin{macrocode}
  1936.      \ifnum \c@secnumdepth >\m@ne
  1937.        \Large\bfseries \partname~\thepart
  1938.        \par\nobreak
  1939.      \fi
  1940.      \huge \bfseries #2%
  1941. %    \end{macrocode}
  1942. %    Now we empty the mark registers, leave some white space and let
  1943. %    |\@afterheading| take care of suppressing the indentation.
  1944. %    \begin{macrocode}
  1945.      \markboth{}{}\par}%
  1946.     \nobreak
  1947.     \vskip 3ex
  1948.     \@afterheading}
  1949. %</article>
  1950. %    \end{macrocode}
  1951. %    When \Lcount{secnumdepth} is larger than $-2$ for the
  1952. %    document class report and book, we have a numbered
  1953. %    part, otherwise it is unnumbered.
  1954. %    \begin{macrocode}
  1955. %<*report|book>
  1956. \def\@part[#1]#2{%
  1957.     \ifnum \c@secnumdepth >-2\relax
  1958.       \refstepcounter{part}%
  1959.       \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
  1960.     \else
  1961.       \addcontentsline{toc}{part}{#1}%
  1962.     \fi
  1963. %    \end{macrocode}
  1964. %    We empty the mark registers and center the title on the page in the
  1965. %    report and book document classes.
  1966. %    Also we prevent breaking between lines and reset the font.
  1967. %    \begin{macrocode}
  1968.     \markboth{}{}
  1969.     {\centering
  1970.      \interlinepenalty \@M
  1971.      \reset@font
  1972. %    \end{macrocode}
  1973. %    When this is a numbered part we have to print the number.
  1974. %    \begin{macrocode}
  1975.      \ifnum \c@secnumdepth >-2\relax
  1976.        \huge\bfseries \partname~\thepart
  1977.        \par
  1978. %    \end{macrocode}
  1979. %    We leave some space before we print the title and leave the
  1980. %    finishing up to |\@endpart|.
  1981. %    \begin{macrocode}
  1982.        \vskip 20\p@
  1983.      \fi
  1984.      \Huge \bfseries #2\par}%
  1985.     \@endpart}
  1986. %</report|book>
  1987. %    \end{macrocode}
  1988. % \end{macro}
  1989. % \begin{macro}{\@spart}
  1990. %    This macro does the actual formatting of the title of the part
  1991. %    when the star form of the user command was used. In this case we
  1992. %    {\em never} print a number. Otherwise the formatting is the same.
  1993. %    The differences between the definition of this macro in the
  1994. %    article document class and in the report and book document
  1995. %    classes are similar as they were for |\@part|.
  1996. %    \begin{macrocode}
  1997. %<*article>
  1998. \def\@spart#1{%
  1999.     {\parindent \z@ \raggedright
  2000.      \interlinepenalty \@M
  2001.      \reset@font
  2002.      \huge \bfseries #1\par}%
  2003.      \nobreak
  2004.      \vskip 3ex
  2005.      \@afterheading}
  2006. %</article>
  2007. %<*report|book>
  2008. \def\@spart#1{%
  2009.     {\centering
  2010.      \interlinepenalty \@M
  2011.      \reset@font
  2012.      \Huge \bfseries #1\par}%
  2013.     \@endpart}
  2014. %</report|book>
  2015. %    \end{macrocode}
  2016. % \end{macro}
  2017. % \begin{macro}{\@endpart}
  2018. %    This macro finishes the part page, for both |\@part| and
  2019. %    |\@spart|.
  2020. %    First we fill the current page.
  2021. %    \begin{macrocode}
  2022. \def\@endpart{\vfil\newpage
  2023. %    \end{macrocode}
  2024. %    Then, when we are in twosided mode, we produce a completely blank
  2025. %    page.
  2026. %    \begin{macrocode}
  2027.               \if@twoside
  2028.                 \hbox{}%
  2029.                 \thispagestyle{empty}%
  2030.                 \newpage
  2031.               \fi
  2032. %    \end{macrocode}
  2033. %    When this was a two column document we have to switch back to two
  2034. %    column mode.
  2035. %    \begin{macrocode}
  2036.               \if@tempswa
  2037.                 \twocolumn
  2038.               \fi}
  2039. %    \end{macrocode}
  2040. % \end{macro}
  2041. % \end{macro}
  2042. % \subsubsection{Chapters}
  2043. % \begin{macro}{\chapter}
  2044. %    A chapter should always start on a new page therefore we start by
  2045. %    calling |\clearpage| and setting the pagestyle for this page to
  2046. %    \pstyle{plain}.
  2047. %    \begin{macrocode}
  2048. %<*report|book>
  2049. \newcommand{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi
  2050.                     \thispagestyle{plain}%
  2051. %    \end{macrocode}
  2052. %    Then we prevent floats from appearing at the top of this page
  2053. %    because it looks weird to see a floating object above a chapter
  2054. %    title.
  2055. %    \begin{macrocode}
  2056.                     \global\@topnum\z@
  2057. %    \end{macrocode}
  2058. %    Then we suppress the indentation of the first paragraph by
  2059. %    setting the switch |\@afterindent| to |false|. We use |\secdef|
  2060. %    to specify the macros to use for actually setting the chapter
  2061. %    title.
  2062. %    \begin{macrocode}
  2063.                     \@afterindentfalse
  2064.                     \secdef\@chapter\@schapter}
  2065. %    \end{macrocode}
  2066. % \begin{macro}{\@chapter}
  2067. %    This macro is called when we have a numbered chapter. When
  2068. %    \Lcount{secnumdepth} is larger than $-1$ and, in the book
  2069. %    class, |\@mainmatter| is true, we display the chapter
  2070. %    number. We also inform the user that a new chapter is about to be
  2071. %    typeset by writing a message to the terminal.
  2072. %    \begin{macrocode}
  2073. \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
  2074. %<book>                       \if@mainmatter
  2075.                          \refstepcounter{chapter}%
  2076.                          \typeout{\@chapapp\space\thechapter.}%
  2077.                          \addcontentsline{toc}{chapter}%
  2078.                                    {\protect\numberline{\thechapter}#1}%
  2079. %<*book>
  2080.                        \else
  2081.                          \addcontentsline{toc}{chapter}{#1}%
  2082.                        \fi
  2083. %</book>
  2084.                     \else
  2085.                       \addcontentsline{toc}{chapter}{#1}%
  2086.                     \fi
  2087. %    \end{macrocode}
  2088. %    After having written an entry to the table of contents we store
  2089. %    the (alternative) title of this chapter with |\chaptermark| and
  2090. %    add some white space to the lists of figures and tables.
  2091. %    \begin{macrocode}
  2092.                     \chaptermark{#1}%
  2093.                     \addtocontents{lof}{\protect\addvspace{10\p@}}%
  2094.                     \addtocontents{lot}{\protect\addvspace{10\p@}}%
  2095. %    \end{macrocode}
  2096. %    Then we call upon |\@makechapterhead| to format the actual
  2097. %    chapter title. We have to do this in a special way when we are in
  2098. %    twocolumn mode in order to have the chapter title use the entire
  2099. %    |\textwidth|. In one column mode we call |\@afterheading| which
  2100. %    takes care of suppressing the indentation.
  2101. %    \begin{macrocode}
  2102.                     \if@twocolumn
  2103.                       \@topnewpage[\@makechapterhead{#2}]%
  2104.                     \else
  2105.                       \@makechapterhead{#2}%
  2106.                       \@afterheading
  2107.                     \fi}
  2108. %    \end{macrocode}
  2109. % \begin{macro}{\@makechapterhead}
  2110. %    The macro above uses |\@makechapterhead|\meta{text} to format the
  2111. %    heading of the chapter.
  2112. %    We begin by leaving some white space. The we open a group in
  2113. %    which we have a paragraph indent of 0pt, and in which we have the
  2114. %    text set ragged right. We also reset the font.
  2115. %    \begin{macrocode}
  2116. \def\@makechapterhead#1{%
  2117.   \vspace*{50\p@}%
  2118.   {\parindent \z@ \raggedright \reset@font
  2119. %    \end{macrocode}
  2120. %    Then we check whether the number of the chapter has to be printed.
  2121. %    If so we leave some whitespace between the chapternumber and its
  2122. %    title.
  2123. % \changes{v1.2v}{1994/11/30}{Added a \cs{nobreak} to prevent a
  2124. %    pagebreak between the chapternumber and the chaptertitle}
  2125. %    \begin{macrocode}
  2126.     \ifnum \c@secnumdepth >\m@ne
  2127. %<book>      \if@mainmatter
  2128.         \huge\bfseries \@chapapp{} \thechapter
  2129.         \par\nobreak
  2130.         \vskip 20\p@
  2131. %<book>      \fi
  2132.     \fi
  2133. %    \end{macrocode}
  2134. %    Now we set the title in a large bold font. We prevent a pagebreak
  2135. %    from occuring in the middle of or after the title. Finally we
  2136. %    leave some whitespace before the text begins.
  2137. % \changes{v1.2v}{1994/11/30}{Added \cs{interlinepenalty}\cs{@M} to
  2138. %    prevent a pagebreak in the middle of a title}
  2139. %    \begin{macrocode}
  2140.     \interlinepenalty\@M
  2141.     \Huge \bfseries #1\par\nobreak
  2142.     \vskip 40\p@
  2143. %    \end{macrocode}
  2144. % \end{macro}
  2145. % \end{macro}
  2146. % \begin{macro}{\@schapter}
  2147. %    This macro is called when we have an unnumbered chapter. It is
  2148. %    much simpler than |\@chapter| because it only needs to typeset
  2149. %    the chapter title.
  2150. %    \begin{macrocode}
  2151. \def\@schapter#1{\if@twocolumn
  2152.                    \@topnewpage[\@makeschapterhead{#1}]%
  2153.                  \else
  2154.                    \@makeschapterhead{#1}%
  2155.                    \@afterheading
  2156.                  \fi}
  2157. %    \end{macrocode}
  2158. % \begin{macro}{\@makeschapterhead}
  2159. %    The macro above uses |\@makeschapterhead|\meta{text}to format
  2160. %    the heading of the chapter. It is similar to |\@makechapterhead|
  2161. %    except that it never has to print a chapter number.
  2162. % \changes{v1.2v}{1994/11/30}{Added \cs{interlinepenalty}\cs{@M} to
  2163. %    prevent a pagebreak in the middle of a title}
  2164. %    \begin{macrocode}
  2165. \def\@makeschapterhead#1{%
  2166.   \vspace*{50\p@}%
  2167.   {\parindent \z@ \raggedright
  2168.     \reset@font
  2169.     \interlinepenalty\@M
  2170.     \Huge \bfseries  #1\par\nobreak
  2171.     \vskip 40\p@
  2172. %</report|book>
  2173. %    \end{macrocode}
  2174. % \end{macro}
  2175. % \end{macro}
  2176. % \end{macro}
  2177. % \subsubsection{Lower level headings}
  2178. %    These commands all make use of |\@startsection|.
  2179. % \begin{macro}{\section}
  2180. %    This gives a normal heading with white space above and below the
  2181. %    heading, the title set in |\Large\bfseries|, and no indentation
  2182. %    on the first paragraph.
  2183. %    \begin{macrocode}
  2184. \newcommand{\section}{\@startsection {section}{1}{\z@}%
  2185.                                    {-3.5ex \@plus -1ex \@minus -.2ex}%
  2186.                                    {2.3ex \@plus.2ex}%
  2187.                                    {\reset@font\Large\bfseries}}
  2188. %    \end{macrocode}
  2189. % \end{macro}
  2190. % \begin{macro}{\subsection}
  2191. %    This gives a normal heading with white space above and below the
  2192. %    heading, the title set in |\large\bfseries|, and no indentation
  2193. %    on the first paragraph.
  2194. %    \begin{macrocode}
  2195. \newcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
  2196.                                      {-3.25ex\@plus -1ex \@minus -.2ex}%
  2197.                                      {1.5ex \@plus .2ex}%
  2198.                                      {\reset@font\large\bfseries}}
  2199. %    \end{macrocode}
  2200. % \end{macro}
  2201. % \begin{macro}{\subsubsection}
  2202. %    This gives a normal heading with white space above and below the
  2203. %    heading, the title set in |\normalsize\bfseries|, and no
  2204. %    indentation on the first paragraph.
  2205. %    \begin{macrocode}
  2206. \newcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
  2207.                                      {-3.25ex\@plus -1ex \@minus -.2ex}%
  2208.                                      {1.5ex \@plus .2ex}%
  2209.                                      {\reset@font\normalsize\bfseries}}
  2210. %    \end{macrocode}
  2211. % \end{macro}
  2212. % \begin{macro}{\paragraph}
  2213. %    This gives a run-in heading with white space above and to the
  2214. %    right of the heading, the title set in |\normalsize\bfseries|.
  2215. %    \begin{macrocode}
  2216. \newcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
  2217.                                     {3.25ex \@plus1ex \@minus.2ex}%
  2218.                                     {-1em}%
  2219.                                     {\reset@font\normalsize\bfseries}}
  2220. %    \end{macrocode}
  2221. % \end{macro}
  2222. % \begin{macro}{\subparagraph}
  2223. %    This gives an indented run-in heading with white space above and
  2224. %    to the right of the heading, the title set in
  2225. %    |\normalsize\bfseries|.
  2226. %    \begin{macrocode}
  2227. \newcommand{\subparagraph}{\@startsection{subparagraph}{5}{\parindent}%
  2228.                                        {3.25ex \@plus1ex \@minus .2ex}%
  2229.                                        {-1em}%
  2230.                                       {\reset@font\normalsize\bfseries}}
  2231. %    \end{macrocode}
  2232. % \end{macro}
  2233. % \subsection{Lists}
  2234. % \subsubsection{General List Parameters}
  2235. % The following commands are used to set the default values for the list
  2236. % environment's parameters. See the \LaTeX{} manual for an explanation
  2237. % of the meanings of the parameters.  Defaults for the list
  2238. % environment are set as follows.  First, |\rightmargin|,
  2239. % |\listparindent| and |\itemindent| are set to 0pt.  Then, for a Kth
  2240. % level list, the command |\@listK| is called, where `K' denotes `i',
  2241. % '`i', ... , `vi'.  (I.e., |\@listiii| is called for a third-level
  2242. % list.)  By convention, |\@listK| should set |\leftmargin| to
  2243. % |\leftmarginK|.
  2244. % \begin{macro}{\leftmargin}
  2245. % \begin{macro}{\leftmargini}
  2246. % \begin{macro}{\leftmarginii}
  2247. % \begin{macro}{\leftmarginiii}
  2248. % \begin{macro}{\leftmarginiv}
  2249. % \begin{macro}{\leftmarginv}
  2250. % \begin{macro}{\leftmarginvi}
  2251. % \changes{v1.0m}{1994/01//12}{use em instead of pt to remain
  2252. %                             compatible with old styles}
  2253. % For efficiency, level-one list's values are defined at top level, and
  2254. % |\@listi| is defined to set only |\leftmargin|.
  2255. % When we are in two column mode some of the margins are set somewhat
  2256. % smaller.
  2257. %    \begin{macrocode}
  2258. \if@twocolumn
  2259.   \setlength\leftmargini  {2em}
  2260. \else
  2261.   \setlength\leftmargini  {2.5em}
  2262. %    \end{macrocode}
  2263. %    The following three are calculated so  that they are larger than
  2264. %    the sum of |\labelsep| and the width of the default labels (which
  2265. %    are `(m)', `vii.' and `M.').
  2266. %    \begin{macrocode}
  2267. \setlength\leftmarginii  {2.2em}
  2268. \setlength\leftmarginiii {1.87em}
  2269. \setlength\leftmarginiv  {1.7em}
  2270. \if@twocolumn
  2271.   \setlength\leftmarginv  {.5em}
  2272.   \setlength\leftmarginvi {.5em}
  2273. \else
  2274.   \setlength\leftmarginv  {1em}
  2275.   \setlength\leftmarginvi {1em}
  2276. %    \end{macrocode}
  2277. %    Here we set the top level leftmargin.
  2278. %    \begin{macrocode}
  2279. \setlength\leftmargin    {\leftmargini}
  2280. %    \end{macrocode}
  2281. % \end{macro}
  2282. % \end{macro}
  2283. % \end{macro}
  2284. % \end{macro}
  2285. % \end{macro}
  2286. % \end{macro}
  2287. % \end{macro}
  2288. % \begin{macro}{\labelsep}
  2289. % \begin{macro}{\labelwidth}
  2290. % \changes{v1.0m}{1994/01//12}{use em instead of pt to remain
  2291. %                             compatible with old styles}
  2292. %    |\labelsep| is the distance between the label and the text of an
  2293. %    item; |\labelwidth| is the width of the label.
  2294. %    \begin{macrocode}
  2295. \setlength  \labelsep  {.5em}
  2296. \setlength  \labelwidth{\leftmargini}
  2297. \addtolength\labelwidth{-\labelsep}
  2298. %    \end{macrocode}
  2299. % \end{macro}
  2300. % \end{macro}
  2301. % \begin{macro}{\partopsep}
  2302. %    When the user leaves a blank line before the environment an extra
  2303. %    vertical space of |\partopsep| is inserted, in addition to
  2304. %    |\parskip| and |\topsep|.
  2305. % \changes{v1.0m}{1994/01//12}{\cmd\partopsep should be different,
  2306. %                             depending on the pointsize}
  2307. %    \begin{macrocode}
  2308. %    \begin{macrocode}
  2309. %</article|report|book>
  2310. %<10pt>\setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
  2311. %<11pt>\setlength\partopsep{3\p@ \@plus 1\p@ \@minus 1\p@}
  2312. %<12pt>\setlength\partopsep{3\p@ \@plus 2\p@ \@minus 2\p@}
  2313. %    \end{macrocode}
  2314. % \end{macro}
  2315. % \begin{macro}{\@beginparpenalty}
  2316. % \begin{macro}{\@endparpenalty}
  2317. %    These penalties are inserted before and after a list or paragraph
  2318. %    environment. They are set to a bonus value to encourage page
  2319. %    breaking at these points.
  2320. % \begin{macro}{\@itempenalty}
  2321. %    This penalty is inserted between list items.
  2322. %    \begin{macrocode}
  2323. %<*article|report|book>
  2324. \@beginparpenalty -\@lowpenalty
  2325. \@endparpenalty   -\@lowpenalty
  2326. \@itempenalty     -\@lowpenalty
  2327. %</article|report|book>
  2328. %    \end{macrocode}
  2329. % \end{macro}
  2330. % \end{macro}
  2331. % \end{macro}
  2332. % \begin{macro}{\@listI}
  2333. % \begin{macro}{\@listi}
  2334. % |\@listI| defines top level and |\@listi| values of
  2335. % |\leftmargin|, |\parsep|, |\topsep|, and |\itemsep|
  2336. %    \begin{macrocode}
  2337. %<*10pt|11pt|12pt>
  2338. \def\@listI{\leftmargin\leftmargini
  2339. %<*10pt>    
  2340.             \parsep 4\p@ \@plus2\p@ \@minus\p@
  2341.             \topsep 8\p@ \@plus2\p@ \@minus4\p@
  2342.             \itemsep4\p@ \@plus2\p@ \@minus\p@}
  2343. %</10pt>            
  2344. %<*11pt>            
  2345.             \parsep 4.5\p@ \@plus2\p@ \@minus\p@
  2346.             \topsep 9\p@   \@plus3\p@ \@minus5\p@
  2347.             \itemsep4.5\p@ \@plus2\p@ \@minus\p@}
  2348. %</11pt>            
  2349. %<*12pt>            
  2350.             \parsep 5\p@  \@plus2.5\p@ \@minus\p@
  2351.             \topsep 10\p@ \@plus4\p@   \@minus6\p@
  2352.             \itemsep5\p@  \@plus2.5\p@ \@minus\p@}
  2353. %</12pt>
  2354. \let\@listi\@listI
  2355. %    \end{macrocode}
  2356. %    We have to initialise these parameters.
  2357. %    \begin{macrocode}
  2358. \@listi
  2359. %    \end{macrocode}
  2360. % \end{macro}
  2361. % \end{macro}
  2362. % \begin{macro}{\@listii}
  2363. % \begin{macro}{\@listiii}
  2364. % \begin{macro}{\@listiv}
  2365. % \begin{macro}{\@listv}
  2366. % \begin{macro}{\@listvi}
  2367. %    Here are the same macros for the higher level lists.
  2368. %    \begin{macrocode}
  2369. \def\@listii {\leftmargin\leftmarginii
  2370.               \labelwidth\leftmarginii
  2371.               \advance\labelwidth-\labelsep
  2372. %<*10pt>
  2373.               \topsep    4\p@ \@plus2\p@ \@minus\p@
  2374.               \parsep    2\p@ \@plus\p@  \@minus\p@
  2375. %</10pt>                 
  2376. %<*11pt>                 
  2377.               \topsep    4.5\p@ \@plus2\p@ \@minus\p@
  2378.               \parsep    2\p@   \@plus\p@  \@minus\p@
  2379. %</11pt>                 
  2380. %<*12pt>                 
  2381.               \topsep    5\p@   \@plus2.5\p@ \@minus\p@
  2382.               \parsep    2.5\p@ \@plus\p@    \@minus\p@
  2383. %</12pt>                 
  2384.               \itemsep   \parsep}
  2385. \def\@listiii{\leftmargin\leftmarginiii
  2386.               \labelwidth\leftmarginiii
  2387.               \advance\labelwidth-\labelsep
  2388. %<10pt>              \topsep    2\p@ \@plus\p@\@minus\p@
  2389. %<11pt>              \topsep    2\p@ \@plus\p@\@minus\p@
  2390. %<12pt>              \topsep    2.5\p@\@plus\p@\@minus\p@
  2391.               \parsep    \z@
  2392.               \partopsep \p@ \@plus\z@ \@minus\p@
  2393.               \itemsep   \topsep}
  2394. \def\@listiv {\leftmargin\leftmarginiv
  2395.               \labelwidth\leftmarginiv
  2396.               \advance\labelwidth-\labelsep}
  2397. \def\@listv  {\leftmargin\leftmarginv
  2398.               \labelwidth\leftmarginv
  2399.               \advance\labelwidth-\labelsep}
  2400. \def\@listvi {\leftmargin\leftmarginvi
  2401.               \labelwidth\leftmarginvi
  2402.               \advance\labelwidth-\labelsep}
  2403. %</10pt|11pt|12pt>
  2404. %    \end{macrocode}
  2405. % \end{macro}
  2406. % \end{macro}
  2407. % \end{macro}
  2408. % \end{macro}
  2409. % \end{macro}
  2410. % \subsubsection{Enumerate}
  2411. %    The enumerate environment uses  four counters: \Lcount{enumi},
  2412. %    \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where
  2413. %    \Lcount{enumN} controls the numbering of the Nth level
  2414. %    enumeration.
  2415. % \begin{macro}{\theenumi}
  2416. % \begin{macro}{\theenumii}
  2417. % \begin{macro}{\theenumiii}
  2418. % \begin{macro}{\theenumiv}
  2419. %    The counters are already defined in \file{latex.dtx}, but their
  2420. %    representation is changed here.
  2421. %    \begin{macrocode}
  2422. %<*article|report|book>
  2423. \renewcommand{\theenumi}{\arabic{enumi}}
  2424. \renewcommand{\theenumii}{\alph{enumii}}
  2425. \renewcommand{\theenumiii}{\roman{enumiii}}
  2426. \renewcommand{\theenumiv}{\Alph{enumiv}}
  2427. %    \end{macrocode}
  2428. % \end{macro}
  2429. % \end{macro}
  2430. % \end{macro}
  2431. % \end{macro}
  2432. % \begin{macro}{\labelenumi}
  2433. % \begin{macro}{\labelenumii}
  2434. % \begin{macro}{\labelenumiii}
  2435. % \begin{macro}{\labelenumiv}
  2436. %    The label for each item is generated by the commands\\
  2437. %    |\labelenumi| \ldots\ |\labelenumiv|.
  2438. %    \begin{macrocode}
  2439. \newcommand{\labelenumi}{\theenumi.}
  2440. \newcommand{\labelenumii}{(\theenumii)}
  2441. \newcommand{\labelenumiii}{\theenumiii.}
  2442. \newcommand{\labelenumiv}{\theenumiv.}
  2443. %    \end{macrocode}
  2444. % \end{macro}
  2445. % \end{macro}
  2446. % \end{macro}
  2447. % \end{macro}
  2448. % \begin{macro}{\p@enumii}
  2449. % \begin{macro}{\p@enumiii}
  2450. % \begin{macro}{\p@enumiv}
  2451. %    The expansion of |\p@enumN||\theenumN| defines the output of a
  2452. %    |\ref| command when referencing an item of the Nth level of an
  2453. %    enumerated list.
  2454. %    \begin{macrocode}
  2455. \renewcommand{\p@enumii}{\theenumi}
  2456. \renewcommand{\p@enumiii}{\theenumi(\theenumii)}
  2457. \renewcommand{\p@enumiv}{\p@enumiii\theenumiii}
  2458. %    \end{macrocode}
  2459. % \end{macro}
  2460. % \end{macro}
  2461. % \end{macro}
  2462. % \subsubsection{Itemize}
  2463. % \begin{macro}{\labelitemi}
  2464. % \begin{macro}{\labelitemii}
  2465. % \changes{v1.2k}{1994/05/06}{Inserted \cmd\normalfont}
  2466. % \begin{macro}{\labelitemiii}
  2467. % \begin{macro}{\labelitemiv}
  2468. %    Itemization is controlled by four commands: |\labelitemi|,
  2469. %    |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which define
  2470. %    the labels of thevarious itemization levels: the symbols used are
  2471. %    bullet, bold en-dash, asterisk and centred dot.
  2472. %    \begin{macrocode}
  2473. \newcommand{\labelitemi}{$\m@th\bullet$}
  2474. \newcommand{\labelitemii}{\normalfont\bfseries --}
  2475. \newcommand{\labelitemiii}{$\m@th\ast$}
  2476. \newcommand{\labelitemiv}{$\m@th\cdot$}
  2477. %    \end{macrocode}
  2478. % \end{macro}
  2479. % \end{macro}
  2480. % \end{macro}
  2481. % \end{macro}
  2482. % \subsubsection{Description}
  2483. % \begin{environment}{description}
  2484. %    The description environment is defined here -- while the itemize
  2485. %    and enumerate environments are defined in \file{latex.dtx}.
  2486. %    \begin{macrocode}
  2487. \newenvironment{description}
  2488.                {\list{}{\labelwidth\z@ \itemindent-\leftmargin
  2489.                         \let\makelabel\descriptionlabel}}
  2490.                {\endlist}
  2491. %    \end{macrocode}
  2492. % \end{environment}
  2493. % \begin{macro}{\descriptionlabel}
  2494. %    To change the formatting of the label, you must redefine
  2495. %    |\descriptionlabel|.
  2496. % \changes{v1.2k}{1994/05/06}{Inserted \cmd\normalfont}
  2497. %    \begin{macrocode}
  2498. \newcommand{\descriptionlabel}[1]{\hspace\labelsep
  2499.                                 \normalfont\bfseries #1}
  2500. %    \end{macrocode}
  2501. % \end{macro}
  2502. % \subsection{Defining new environments}
  2503. % \subsubsection{Abstract}
  2504. % \begin{environment}{abstract}
  2505. %    When we are producing a separate titlepage we also put the
  2506. %    abstract on a page of its own. It will be centred vertically on
  2507. %    the page.
  2508. %    Note that this environment is not defined for books.
  2509. %    \begin{macrocode}
  2510. %<*article|report>
  2511. \if@titlepage
  2512.   \newenvironment{abstract}{%
  2513.       \titlepage
  2514.       \null\vfil
  2515.       \begin{center}
  2516.         \bfseries \abstractname
  2517.       \end{center}}
  2518.      {\par\vfil\null\endtitlepage}
  2519. %    \end{macrocode}
  2520. %    When we are not making a separate titlepage --the default for the
  2521. %    article document class-- we have to check if we are in twocolumn
  2522. %    mode. In that case the abstract is as a |\section*|, otherwise
  2523. %    the quotation environment is used to typeset the abstract.
  2524. %    \begin{macrocode}
  2525. \else
  2526.   \newenvironment{abstract}{%
  2527.       \if@twocolumn
  2528.         \section*{\abstractname}%
  2529.       \else
  2530.         \small
  2531.         \begin{center}%
  2532.           {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
  2533.         \end{center}%
  2534.         \quotation
  2535.       \fi}
  2536.       {\if@twocolumn\else\endquotation\fi}
  2537. %</article|report>
  2538. %    \end{macrocode}
  2539. % \end{environment}
  2540. % \subsubsection{Verse}
  2541. % \begin{environment}{verse}
  2542. %   The verse environment is defined by making clever use of the
  2543. %   list environment's parameters.  The user types |\\| to end a line.
  2544. %   This is implemented by |\let|'ing |\\| equal |\@centercr|.
  2545. %    \begin{macrocode}
  2546. \newenvironment{verse}
  2547.                {\let\\=\@centercr
  2548.                 \list{}{\itemsep      \z@
  2549.                         \itemindent   -1.5em%
  2550.                         \listparindent\itemindent
  2551.                         \rightmargin  \leftmargin
  2552.                         \advance\leftmargin 1.5em}%
  2553.                 \item[]}
  2554.                {\endlist}
  2555. %    \end{macrocode}
  2556. % \end{environment}
  2557. % \subsubsection{Quotation}
  2558. % \begin{environment}{quotation}
  2559. %   The quotation environment is also defined by making clever use of
  2560. %   the list environment's parameters. The lines in the environment
  2561. %   are set smaller than |\textwidth|. The first line of a paragraph
  2562. %   inside this environment is indented.
  2563. %    \begin{macrocode}
  2564. \newenvironment{quotation}
  2565.                {\list{}{\listparindent 1.5em%
  2566.                         \itemindent    \listparindent
  2567.                         \rightmargin   \leftmargin
  2568.                         \parsep        \z@ \@plus\p@}%
  2569.                 \item[]}
  2570.                {\endlist}
  2571. %    \end{macrocode}
  2572. % \end{environment}
  2573. % \subsubsection{Quote}
  2574. % \begin{environment}{quote}
  2575. %   The quote environment is like the quotation environment except
  2576. %   that paragraphs are not indented.
  2577. %    \begin{macrocode}
  2578. \newenvironment{quote}
  2579.                {\list{}{\rightmargin\leftmargin}%
  2580.                 \item[]}
  2581.                {\endlist}
  2582. %    \end{macrocode}
  2583. % \end{environment}
  2584. % \subsubsection{Theorem}
  2585. %    This document class does not define it's own theorem environments,
  2586. %    the defaults, supplied by \file{latex.dtx} are available.
  2587. % \subsubsection{Titlepage}
  2588. % \begin{environment}{titlepage}
  2589. %  In the normal environments, the titlepage environment does nothing
  2590. %  but start and end a page, and inhibit page numbers.  In the report
  2591. %  style, it also resets the page number to one, and then sets it
  2592. %  back to one at the end.  In compatibility mode, it sets the
  2593. %  page number to zero. In two-column style, it still makes a 
  2594. %  one-column page.
  2595. % \changes{v1.0g}{1993/12/09}{Moved the setting of
  2596. %                             \cmd\@restonecolfalse}
  2597. % \changes{v1.2c}{1994/03/17}{page := 0 only in compatibility mode (LL)}
  2598. % \changes{v1.2d}{1994/04/11}{Moved \cmd\cleardoublepage inside
  2599. %    definition of titlepage environment}
  2600. %    \begin{macrocode}
  2601. \newenvironment{titlepage}
  2602.     {%
  2603. %<book>      \cleardoublepage
  2604.       \if@twocolumn
  2605.         \@restonecoltrue\onecolumn
  2606.       \else
  2607.         \@restonecolfalse\newpage
  2608.       \fi
  2609.       \thispagestyle{empty}%
  2610.       \if@compatibility
  2611.         \setcounter{page}{0}
  2612. %<*report|article>
  2613.       \else
  2614.         \setcounter{page}{1}%
  2615. %</report|article>
  2616.       \fi}%
  2617.     {\if@restonecol\twocolumn \else \newpage \fi
  2618. %<report|article>      \setcounter{page}{1}%
  2619.     }
  2620. %    \end{macrocode}
  2621. % \end{environment}
  2622. % \subsubsection{Appendix}
  2623. % \begin{macro}{\appendix}
  2624. %    The |\appendix| command is not really an environment, it is a
  2625. %    macro that makes some changes in the way things are done.
  2626. %    In the article document class the |\appendix| command must do the
  2627. %    following:
  2628. %    \begin{itemize}
  2629. %    \item reset the section and subsection counters to zero,
  2630. %    \item redefine |\thesection| to produce alphabetic appendix
  2631. %        numbers.
  2632. %    \end{itemize}
  2633. %    \begin{macrocode}
  2634. %<*article>
  2635. \newcommand{\appendix}{\par
  2636.   \setcounter{section}{0}%
  2637.   \setcounter{subsection}{0}%
  2638.   \renewcommand{\thesection}{\Alph{section}}}
  2639. %</article>
  2640. %    \end{macrocode}
  2641. %    In the report and book document classes the |\appendix| command
  2642. %    must do the following:
  2643. %    \begin{itemize}
  2644. %    \item reset the chapter and section counters to zero,
  2645. %    \item set |\@chapapp| to |\appendixname| (for messages),
  2646. %    \item redefine the chapter counter to produce appendix numbers,
  2647. %    \item possibly redefine the |\chapter| command if appendix titles
  2648. %        and headings are to look different from chapter titles and
  2649. %        headings.
  2650. %    \end{itemize}
  2651. %    \begin{macrocode}
  2652. %<*report|book>
  2653. \newcommand{\appendix}{\par
  2654.   \setcounter{chapter}{0}%
  2655.   \setcounter{section}{0}%
  2656.   \renewcommand{\@chapapp}{\appendixname}%
  2657.   \renewcommand{\thechapter}{\Alph{chapter}}}
  2658. %</report|book>
  2659. %    \end{macrocode}
  2660. % \end{macro}
  2661. % \subsection{Setting parameters for existing environments}
  2662. % \subsubsection{Array and tabular}
  2663. % \begin{macro}{\arraycolsep}
  2664. %    The columns in an array environment are separated by
  2665. %    2|\arraycolsep|.
  2666. %    \begin{macrocode}
  2667. \setlength\arraycolsep{5\p@}
  2668. %    \end{macrocode}
  2669. % \end{macro}
  2670. % \begin{macro}{\tabcolsep}
  2671. %    The columns in an tabular environment are separated by
  2672. %    2|\tabcolsep|.
  2673. %    \begin{macrocode}
  2674. \setlength\tabcolsep{6\p@}
  2675. %    \end{macrocode}
  2676. % \end{macro}
  2677. % \begin{macro}{\arrayrulewidth}
  2678. %    The width of rules in the array and tabular environments is given
  2679. %    by\\ |\arrayrulewidth|.
  2680. %    \begin{macrocode}
  2681. \setlength\arrayrulewidth{.4\p@}
  2682. %    \end{macrocode}
  2683. % \end{macro}
  2684. % \begin{macro}{\doublerulesep}
  2685. %    The space between adjacent rules in the array and tabular
  2686. %    environments is given by |\doublerulesep|.
  2687. %    \begin{macrocode}
  2688. \setlength\doublerulesep{2\p@}
  2689. %    \end{macrocode}
  2690. % \end{macro}
  2691. % \subsubsection{Tabbing}
  2692. % \begin{macro}{\tabbingsep}
  2693. %    This controls the space that the |\'| command puts in. (See
  2694. %    \LaTeX{} manual for an explanation.)
  2695. %    \begin{macrocode}
  2696. \setlength\tabbingsep{\labelsep}
  2697. %    \end{macrocode}
  2698. % \end{macro}
  2699. % \subsubsection{Minipage}
  2700. % \begin{macro}{\@minipagerestore}
  2701. %    The macro |\@minipagerestore| is called upon entry to a minipage
  2702. %    environment to set up things that are to be handled differently
  2703. %    inside a minipage environment. In the current styles, it does
  2704. %    nothing.
  2705. % \end{macro}
  2706. % \begin{macro}{\@mpfootins}
  2707. %    Minipages have their own footnotes; |\skip||\@mpfootins| plays
  2708. %    same r\^ole for footnotes in a minipage as |\skip||\footins| does
  2709. %    for ordinary footnotes.
  2710. %    \begin{macrocode}
  2711. \skip\@mpfootins = \skip\footins
  2712. %    \end{macrocode}
  2713. % \end{macro}
  2714. % \subsubsection{Framed boxes}
  2715. % \begin{macro}{\fboxsep}
  2716. %    The space left by |\fbox| and |\framebox| between the box and the
  2717. %    text in it.
  2718. % \begin{macro}{\fboxrule}
  2719. %    The width of the rules in the box made by |\fbox| and |\framebox|.
  2720. %    \begin{macrocode}
  2721. \setlength\fboxsep{3\p@}
  2722. \setlength\fboxrule{.4\p@}
  2723. %    \end{macrocode}
  2724. % \end{macro}
  2725. % \end{macro}
  2726. % \subsubsection{Equation and eqnarray}
  2727. % \begin{macro}{\theequation}
  2728. %    The equation counter will be reset at beginning of a new chapter
  2729. %    and the equation number will be prefixed by the chapter number.
  2730. %    This code  must follow the |\chapter| definition, or more exactly
  2731. %    the definition of the chapter counter.
  2732. %    \begin{macrocode}
  2733. %<article>\renewcommand{\theequation}{\arabic{equation}}
  2734. %<*report|book>
  2735. \@addtoreset{equation}{chapter}
  2736. \renewcommand{\theequation}{\thechapter.\arabic{equation}}
  2737. %</report|book>
  2738. %    \end{macrocode}
  2739. % \end{macro}
  2740. % \begin{macro}{\jot}
  2741. %    |\jot| is the extra space added between lines of an eqnarray
  2742. %    environment. The default value is used.
  2743. %    \begin{macrocode}
  2744. % \setlength\jot{3pt}
  2745. %    \end{macrocode}
  2746. % \end{macro}
  2747. % \begin{macro}{\@eqnnum}
  2748. %    The macro |\@eqnnum| defines how equation numbers are to appear in
  2749. %    equations. Again the default is used.
  2750. %    \begin{macrocode}
  2751. % \def\@eqnnum{(\theequation)}
  2752. %    \end{macrocode}
  2753. % \end{macro}
  2754. % \subsection{Floating objects}
  2755. %    The file \file{latex.dtx} only defines a number of tools with
  2756. %    which floating objects can be defined. This is done in the
  2757. %    document class. It needs to define the following macros for each
  2758. %    floating object of type \texttt{TYPE} (e.g., \texttt{TYPE} =
  2759. %    figure).
  2760. %    \begin{description}
  2761. %    \item[\texttt{\bslash fps@TYPE}]
  2762. %        The default placement specifier for floats of type
  2763. %        \texttt{TYPE}.
  2764. %    \item[\texttt{\bslash ftype@TYPE}]
  2765. %        The type number for floats of type \texttt{TYPE}.  Each
  2766. %        \texttt{TYPE} has associated a unique positive \texttt
  2767. %        {TYPE} number, which is a power of two.  E.g., figures might
  2768. %        have type number 1, tables type number 2, programs type
  2769. %        number 4, etc.
  2770. %    \item[\texttt{\bslash ext@TYPE}]
  2771. %        The file extension indicating the file on which the contents
  2772. %        list for float type \texttt{TYPE} is stored.  For example,
  2773. %        |\ext@figure| = `lof'.
  2774. %    \item[\texttt{\bslash fnum@TYPE}]
  2775. %        A macro to generate the figure number for a caption. For
  2776. %        example, |\fnum@TYPE| == `Figure |\thefigure|'.
  2777. %    \item[\texttt{\bslash @makecaption}{\meta{num}}{\meta{text}}]
  2778. %        A macro to make a caption, with \meta{num} the value produced
  2779. %        by |\fnum@...| and \meta{text} the text of the caption. It
  2780. %        can assume it's in a |\parbox| of the appropriate width.
  2781. %        This will be used for \emph{all} floating objects.
  2782. %    \end{description}
  2783. %    The actual environment that implements a floating object such as
  2784. %    a figure is defined using the macros |\@float| and |\end@float|,
  2785. %    which are defined in \file{latex.dtx}.
  2786. %    An environment that implements a single column floating object is
  2787. %    started with |\@float{|\texttt{TYPE}|}[|\meta{placement}|]| of type
  2788. %    \texttt{TYPE} with \meta{placement} as the placement specifier.
  2789. %    The default value of \meta{PLACEMENT} is defined by |\fps@TYPE|.
  2790. %    The environment is ended by |\end@float|.  E.g., |\figure| ==
  2791. %    |\@float|{figure}, |\endfigure| == |\end@float|.
  2792. % \subsubsection{Figure}
  2793. %    Here is the implementation of the figure environment.
  2794. % \begin{macro}{\c@figure}
  2795. %    First we have to allocate a counter to number the figures. In the
  2796. %    report and book document classes the figures are numbered per
  2797. %    chapter.
  2798. %    \begin{macrocode}
  2799. %<*article>
  2800. \newcounter{figure}
  2801. \renewcommand{\thefigure}{\@arabic\c@figure}
  2802. %</article>
  2803. %<*report|book>
  2804. \newcounter{figure}[chapter]
  2805. \renewcommand{\thefigure}{\thechapter.\@arabic\c@figure}
  2806. %</report|book>
  2807. %    \end{macrocode}
  2808. % \end{macro}
  2809. % \begin{macro}{\fps@figure}
  2810. % \begin{macro}{\ftype@figure}
  2811. % \begin{macro}{\ext@figure}
  2812. % \begin{macro}{\num@figure}
  2813. %    Here are the parameters for the floating objects of type `figure'.
  2814. %    \begin{macrocode}
  2815. \def\fps@figure{tbp}
  2816. \def\ftype@figure{1}
  2817. \def\ext@figure{lof}
  2818. \def\fnum@figure{\figurename~\thefigure}
  2819. %    \end{macrocode}
  2820. % \end{macro}
  2821. % \end{macro}
  2822. % \end{macro}
  2823. % \end{macro}
  2824. % \begin{environment}{figure}
  2825. % \begin{environment}{figure*}
  2826. %    And the definition of the actual environment. The form with the
  2827. %    |*| is used for double column figures.
  2828. %    \begin{macrocode}
  2829. \newenvironment{figure}
  2830.                {\@float{figure}}
  2831.                {\end@float}
  2832. \newenvironment{figure*}
  2833.                {\@dblfloat{figure}}
  2834.                {\end@dblfloat}
  2835. %    \end{macrocode}
  2836. % \end{environment}
  2837. % \end{environment}
  2838. % \subsubsection{Table}
  2839. %    Here is the implementation of the table environment. It is very
  2840. %    much the same as the figure environment.
  2841. % \begin{macro}{\c@table}
  2842. %    First we have to allocate a counter to number the tables. In the
  2843. %    report and book document classes the tables are numbered per
  2844. %    chapter.
  2845. %    \begin{macrocode}
  2846. %<*article>
  2847. \newcounter{table}
  2848. \renewcommand{\thetable}{\@arabic\c@table}
  2849. %</article>
  2850. %<*report|book>
  2851. \newcounter{table}[chapter]
  2852. \renewcommand{\thetable}{\thechapter.\@arabic\c@table}
  2853. %</report|book>
  2854. %    \end{macrocode}
  2855. % \end{macro}
  2856. % \begin{macro}{\fps@table}
  2857. % \begin{macro}{\ftype@table}
  2858. % \begin{macro}{\ext@table}
  2859. % \begin{macro}{\num@table}
  2860. %    Here are the parameters for the floating objects of type `table'.
  2861. %    \begin{macrocode}
  2862. \def\fps@table{tbp}
  2863. \def\ftype@table{2}
  2864. \def\ext@table{lot}
  2865. \def\fnum@table{\tablename~\thetable}
  2866. %    \end{macrocode}
  2867. % \end{macro}
  2868. % \end{macro}
  2869. % \end{macro}
  2870. % \end{macro}
  2871. % \begin{environment}{table}
  2872. % \begin{environment}{table*}
  2873. %    And the definition of the actual environment. The form with the
  2874. %    |*| is used for double column tables.
  2875. %    \begin{macrocode}
  2876. \newenvironment{table}
  2877.                {\@float{table}}
  2878.                {\end@float}
  2879. \newenvironment{table*}
  2880.                {\@dblfloat{table}}
  2881.                {\end@dblfloat}
  2882. %    \end{macrocode}
  2883. % \end{environment}
  2884. % \end{environment}
  2885. % \subsubsection{Captions}
  2886. % \begin{macro}{\@makecaption}
  2887. %    The |\caption| command calls |\@makecaption| to format the
  2888. %    caption of floating objects. It gets two arguments,
  2889. %    \meta{number}, the number of the floating object and \meta{text},
  2890. %    the text of the caption. Usually \meta{number} contains a string
  2891. %    such as `Figure 3.2'. The macro can assume it is called inside a
  2892. %    |\parbox| of right width, with |\normalsize|.
  2893. % \begin{macro}{\abovecaptionskip}
  2894. % \begin{macro}{\belowcaptionskip}
  2895. %    These lengths contain the amount of white space to leave above
  2896. %    and below the caption.
  2897. %    \begin{macrocode}
  2898. \newlength\abovecaptionskip
  2899. \newlength\belowcaptionskip
  2900. \setlength\abovecaptionskip{10\p@}
  2901. \setlength\belowcaptionskip{0\p@}
  2902. %    \end{macrocode}
  2903. % \end{macro}
  2904. % \end{macro}
  2905. %    The definition of this macro is |\long| in order to allow more
  2906. %    then one paragraph in a caption.
  2907. %    \begin{macrocode}
  2908. \long\def\@makecaption#1#2{%
  2909.   \vskip\abovecaptionskip
  2910. %    \end{macrocode}
  2911. %    We want to see if the caption fits on one line on the page,
  2912. %    therefore we first typeset it in a temporary box.
  2913. % \changes{v1.2q}{1994/05/29}{Use \cs{sbox}\cs{@tempboxa} instead of
  2914. %    \cs{setbox}\cs{@tempboxa}\cs{hbox} to make this colour safe}
  2915. %    \begin{macrocode}
  2916.   \sbox\@tempboxa{#1: #2}%
  2917. %    \end{macrocode}
  2918. %    We can the measure its width. It that is larger than the current
  2919. %    |\hsize| we typeset the caption as an ordinary paragraph.
  2920. %    \begin{macrocode}
  2921.   \ifdim \wd\@tempboxa >\hsize
  2922.     #1: #2\par
  2923. %    \end{macrocode}
  2924. %    If the caption fits, we center it. Because this uses an |\hbox|
  2925. %    directly in vertical mode, it does not execute the |\everypar|
  2926. %    tokens; the only thing that could be needed here is resetting the
  2927. %    `minipage flag' so we do this explicitly.
  2928. % \changes{v1.2x}{1994/12/09}{Due to a change in the way floats are
  2929. %    handled we need to set the \cs{if@minipage} switch to false}
  2930. %    \begin{macrocode}
  2931.   \else
  2932.     \global \@minipagefalse
  2933.     \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
  2934.   \fi
  2935.   \vskip\belowcaptionskip}
  2936. %    \end{macrocode}
  2937. % \end{macro}
  2938. % \subsection{Font changing}
  2939. %    Here we supply the declarative font changing commands that were
  2940. %    common in \LaTeX\ version 2.09 and earlier. These commands work
  2941. %    in text mode \emph{and} in math mode. They are provided for
  2942. %    compatibility, but one should start using the |\text...| and
  2943. %    |\math...| commands instead. These commands are defined using
  2944. %    |\DeclareTextFontCommand|, a command with three arguments: the
  2945. %    user command to be defined; \LaTeX\ commands to execute in text
  2946. %    mode and \LaTeX\ commands to execute in math mode.
  2947. % \changes{v1.0g}{1993/12/12}{Distinguished between compatibility and
  2948. %    `normal' mode for the font changing commands.}
  2949. % \changes{v1.0h}{1993/12/18}{These are now defined in the kernel,
  2950. %    so use \cmd\@renewfontswitch.  Compatibility mode defines
  2951. %    \cmd\@renewfontswitch to do nothing, so we don't need to check for
  2952. %    compatibility mode any more.}
  2953. % \changes{v1.0j}{1993/12/20}{Added \cmd\normalfont back in the
  2954. %    definitions of \cmd\rm etc. as this should be the default
  2955. %    behaviour}
  2956. % \changes{v1.2e}{1994/04/14}{\cmd\@renewfontswitch has become
  2957. %    \cmd\DeclareOldFontCommand}
  2958. %  \begin{macro}{\rm}
  2959. % \changes{v1.0f}{1993/12/08}{Macro added}
  2960. %  \begin{macro}{\tt}
  2961. % \changes{v1.0f}{1993/12/08}{Macro added}
  2962. %  \begin{macro}{\sf}
  2963. % \changes{v1.0f}{1993/12/08}{Macro added}
  2964. %    The commands to change the family. When in compatibility mode we
  2965. %    select the `default' font first, to get \LaTeX2.09 behviour.
  2966. %    \begin{macrocode}
  2967. \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
  2968. \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
  2969. \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
  2970. %    \end{macrocode}
  2971. %  \end{macro}
  2972. %  \end{macro}
  2973. %  \end{macro}
  2974. %  \begin{macro}{\bf}
  2975. % \changes{v1.0f}{1993/12/08}{Macro added}
  2976. %    The command to change to the bold series. One should use
  2977. %    |\mdseries| to explicitly switch back to medium series.
  2978. %    \begin{macrocode}
  2979. \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
  2980. %    \end{macrocode}
  2981. %  \end{macro}
  2982. %  \begin{macro}{\sl}
  2983. % \changes{v1.0f}{1993/12/08}{Macro added}
  2984. % \changes{v1.2g}{1994/04/24}{Added warning if used in math mode}
  2985. %  \begin{macro}{\it}
  2986. % \changes{v1.0f}{1993/12/08}{Macro added}
  2987. %  \begin{macro}{\sc}
  2988. % \changes{v1.0f}{1993/12/08}{Macro added}
  2989. % \changes{v1.2g}{1994/04/24}{Added warning if used in math mode}
  2990. %    And the commands to change the shape of the font. The slanted and
  2991. %    small caps shapes are not available by default as math alphabets,
  2992. %    so those changes do nothing in math mode. However, we do warn the
  2993. %    user that the selection will not have any effect.One should use
  2994. %    |\upshape| to explicitly change back to the upright shape.
  2995. %    \begin{macrocode}
  2996. \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
  2997. \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
  2998. \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
  2999. %    \end{macrocode}
  3000. %  \end{macro}
  3001. %  \end{macro}
  3002. %  \end{macro}
  3003. % \begin{macro}{\cal}
  3004. % \changes{v1.0g}{1993/12/12}{Macro added}
  3005. % \begin{macro}{\mit}
  3006. % \changes{v1.0g}{1993/12/12}{Macro added}
  3007. %    The commands |\cal| and |\mit| should only be used in math mode,
  3008. %    outside math mode they have no effect. Currently the New Font
  3009. %    Selection Scheme defines these commands to generate warning
  3010. %    messages. Therefore we have to define them `by hand'.
  3011. % \changes{v1.2w}{1994/12/01}{Now define \cs{cal} and \cs{mit} using
  3012. %    \cs{DeclareRobustCommand*}}
  3013. %    \begin{macrocode}
  3014. \DeclareRobustCommand*{\cal}{\@fontswitch{\relax}{\mathcal}}
  3015. \DeclareRobustCommand*{\mit}{\@fontswitch{\relax}{\mathnormal}}
  3016. %    \end{macrocode}
  3017. %  \end{macro}
  3018. %  \end{macro}
  3019. % \section{Cross Referencing}
  3020. % \subsection{Table of Contents, etc.}
  3021. %     A |\section| command writes a
  3022. %     |\contentsline{section}{|\meta{title}|}{|\meta{page}|}| command
  3023. %     on the \file{.toc} file, where \meta{title} contains the
  3024. %     contents of the entry and \meta{page} is the page number. If
  3025. %     sections are being numbered, then \meta{title} will be of the
  3026. %     form |\numberline{|\meta{num}|}{|\meta{heading}|}| where
  3027. %     \meta{num} is the number produced by |\thesection|.  Other
  3028. %     sectioning commands work similarly.
  3029. %     A |\caption| command in a `figure' environment writes
  3030. %     |\contentsline{figure}{\numberline{|\meta{num}|}{|%
  3031. %                    \meta{caption}|}}{|\meta{page}|}|
  3032. %     on the .\file{lof} file, where \meta{num} is the number produced
  3033. %     by |\thefigure| and \meta{caption} is the figure caption.  It
  3034. %     works similarly for a `table' environment.
  3035. %    The command |\contentsline{|\meta{name}|}| expands to
  3036. %    |\l@|\meta{name}.  So, to specify the table of contents, we must
  3037. %    define |\l@chapter|, |\l@section|, |\l@subsection|, ... ; to
  3038. %    specify the list of figures, we must define |\l@figure|; and so
  3039. %    on.  Most of these can be defined with the |\@dottedtocline|
  3040. %    command, which works as follows.
  3041. %    |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|^^A
  3042. %                      \meta{numwidth}|}{|^^A
  3043. %                      \meta{title}|}{|\meta{page}|}|
  3044. %    \begin{description}
  3045. %    \item[\meta{level}] An entry is produced only if\meta{ level}
  3046. %        $<=$ value of the \Lcount{tocdepth} counter.  Note,
  3047. %        |\chapter| is level 0, |\section| is level 1, etc.
  3048. %    \item[\meta{indent}] The indentation from the outer left margin
  3049. %        of the start   of the contents line.
  3050. %    \item[\meta{numwidth}] The width of a box in which the section
  3051. %        number is to go, if \meta{title} includes a |\numberline|
  3052. %        command.
  3053. %    \end{description}
  3054. % \begin{macro}{\@pnumwidth}
  3055. % \begin{macro}{\@tocrmarg}
  3056. % \begin{macro}{\@dotsep}
  3057. %    This command uses the following three parameters, which are set
  3058. %    with a |\newcommand| (so em's can be used to make them depend upon
  3059. %    the font).
  3060. %    \begin{description}
  3061. %    \item[\texttt{\bslash @pnumwidth}] The width of a box in which the
  3062. %        page number is put.
  3063. % \changes{v1.2v}{1994/10/29}{Changed documentation from > or = to
  3064. %    $\ge$}
  3065. %    \item[\texttt{\bslash @tocrmarg}] The right margin for multiple
  3066. %        line entries.  One wants |\@tocrmarg| $\ge$ |\@pnumwidth|
  3067. %    \item[\texttt{\bslash @dotsep}] Separation between dots, in mu
  3068. %        units. Should be defined as a number like 2 or 1.7
  3069. %    \end{description}
  3070. %    \begin{macrocode}
  3071. \newcommand{\@pnumwidth}{1.55em}
  3072. \newcommand{\@tocrmarg} {2.55em}
  3073. \newcommand{\@dotsep}{4.5}
  3074. %<article>\setcounter{tocdepth}{3}
  3075. %<!article>\setcounter{tocdepth}{2}
  3076. %    \end{macrocode}
  3077. % \end{macro}
  3078. % \end{macro}
  3079. % \end{macro}
  3080. % \subsubsection{Table of Contents}
  3081. % \begin{macro}{\tableofcontents}
  3082. %    This macro is used to request that \LaTeX{} produces a table of
  3083. %    contents. In the report and book document classes the tables of
  3084. %    contents, figures etc. are always set in single-column style.
  3085. % \changes{v1.0g}{1993/12/09}{Moved the setting of
  3086. %    \cmd\@restonecolfalse}
  3087. %    \begin{macrocode}
  3088. \newcommand{\tableofcontents}{%
  3089. %<*report|book>
  3090.     \if@twocolumn
  3091.       \@restonecoltrue\onecolumn
  3092.     \else
  3093.       \@restonecolfalse
  3094.     \fi
  3095. %    \end{macrocode}
  3096. %    The title is set using the |\chapter*| command, making sure that
  3097. %    the running head --if one is required-- contains the right
  3098. %    information.
  3099. %    \begin{macrocode}
  3100.     \chapter*{\contentsname
  3101. %</report|book>
  3102. %<article>    \section*{\contentsname
  3103.         \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}%
  3104. %    \end{macrocode}
  3105. %    The the actual table of contents is made by calling
  3106. %    |\@starttoc{toc}|. After that we restore twocolumn mode if
  3107. %    necessary.
  3108. %    \begin{macrocode}
  3109.     \@starttoc{toc}%
  3110. %<!article>    \if@restonecol\twocolumn\fi
  3111.     }
  3112. %    \end{macrocode}
  3113. % \end{macro}
  3114. % \begin{macro}{\l@part}
  3115. %    Each sectioning command needs an additional macro  to format its
  3116. %    entry in the table of contents, as described above. The macro for
  3117. %    the entry for parts is defined in a special way.
  3118. %    First we make sure that if a pagebreak should occur, it occurs
  3119. %    {\em before} this entry. Also a little whitespace is added and a
  3120. %    group begun to keep changes local.
  3121. % \changes{v1.0h}{1993/12/18}{Replaced -\cmd\@secpenalty by
  3122. %    \cmd\@secpenalty.  ASAJ.}
  3123. % \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth
  3124. %    counter is less then -1}
  3125. %    \begin{macrocode}
  3126. \newcommand*{\l@part}[2]{%
  3127.   \ifnum \c@tocdepth >-2\relax
  3128. %<article>    \addpenalty{\@secpenalty}%
  3129. %<!article>    \addpenalty{-\@highpenalty}%
  3130.     \addvspace{2.25em \@plus\p@}%
  3131.     \begingroup
  3132. %    \end{macrocode}
  3133. %    The macro |\numberline| requires that the width of the box that
  3134. %    holds the part number is stored in \LaTeX's scratch register
  3135. %    |\@tempdima|. Therefore we put it there.
  3136. %    \begin{macrocode}
  3137.       \setlength\@tempdima{3em}%
  3138. %    \end{macrocode}
  3139. %    The we set |\parindent| to 0pt and use |\rightskip| to leave
  3140. %    enough room for the pagenumbers. To prevent overfull box messages
  3141. %    the |\parfillskip| is set to a negative value.
  3142. %    \begin{macrocode}
  3143.       \parindent \z@ \rightskip \@pnumwidth
  3144.       \parfillskip -\@pnumwidth
  3145. %    \end{macrocode}
  3146. %    Now we can set the entry, in a large bold font. We make sure to
  3147. %    leave vertical mode, set the part title and add the pagenumber,
  3148. %    set flush right.
  3149. %    \begin{macrocode}
  3150.       {\leavevmode
  3151.        \large \bfseries #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
  3152. %    \end{macrocode}
  3153. %    Prevent a pagebreak immediately after this entry, but use
  3154. %    |\everypar| to reset the |\if@nobreak| switch. Finally we close
  3155. %    the group.
  3156. %    \begin{macrocode}
  3157.        \nobreak
  3158. %<article>       \if@compatibility
  3159.          \global\@nobreaktrue
  3160.          \everypar{\global\@nobreakfalse\everypar{}}
  3161. %<article>      \fi
  3162.     \endgroup
  3163.   \fi}
  3164. %    \end{macrocode}
  3165. % \end{macro}
  3166. % \begin{macro}{\l@chapter}
  3167. %    This macro formats the entries in the table of contents for
  3168. %    chapters. It is very similar to |\l@part|
  3169. %    First we make sure that if a pagebreak should occur, it occurs
  3170. %    {\em before} this entry. Also a little whitespace is added and a
  3171. %    group begun to keep changes local.
  3172. % \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth
  3173. %    counter is less then 0}
  3174. %    \begin{macrocode}
  3175. %<*report|book>
  3176. \newcommand*{\l@chapter}[2]{%
  3177.   \ifnum \c@tocdepth >\m@ne
  3178.     \addpenalty{-\@highpenalty}%
  3179.     \vskip 1.0em \@plus\p@
  3180. %    \end{macrocode}
  3181. %    The macro |\numberline| requires that the width of the box that
  3182. %    holds the part number is stored in \LaTeX's scratch register
  3183. %    |\@tempdima|. Therefore we put it there. We begin a group, and
  3184. %    change some of the paragraph parameters.
  3185. %    \begin{macrocode}
  3186.     \setlength\@tempdima{1.5em}%
  3187.     \begingroup
  3188.       \parindent \z@ \rightskip \@pnumwidth
  3189.       \parfillskip -\@pnumwidth
  3190. %    \end{macrocode}
  3191. %    Then we leave vertical mode and switch to a bold font.
  3192. %    \begin{macrocode}
  3193.       \leavevmode \bfseries
  3194. %    \end{macrocode}
  3195. %    Because we do not use |\numberline| here, we have do some fine
  3196. %    tuning `by hand', before we can set the entry. We discourage but
  3197. %    not disallow a pagebreak immediately after a chapter entry.
  3198. %    \begin{macrocode}
  3199.       \advance\leftskip\@tempdima
  3200.       \hskip -\leftskip
  3201.       #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
  3202.       \penalty\@highpenalty
  3203.     \endgroup
  3204.   \fi}
  3205. %</report|book>
  3206. %    \end{macrocode}
  3207. % \end{macro}
  3208. % \begin{macro}{\l@section}
  3209. %    In the article document class the entry in the table of contents
  3210. %    for sections looks much like the chapter entries for the report
  3211. %    and book document classes.
  3212. %    First we make sure that if a pagebreak should occur, it occurs
  3213. %    {\em before} this entry. Also a little whitespace is added and a
  3214. %    group begun to keep changes local.
  3215. % \changes{v1.0h}{1993/12/18}{Replaced -\cmd\@secpenalty by
  3216. %    \cmd\@secpenalty.  ASAJ.}
  3217. % \changes{v1.2i}{1994/04/28}{Don't print a toc line when the tocdepth
  3218. %    counter is less then 1}
  3219. %    \begin{macrocode}
  3220. %<*article>
  3221. \newcommand*{\l@section}[2]{%
  3222.   \ifnum \c@tocdepth >\z@
  3223.     \addpenalty{\@secpenalty}%
  3224.     \addvspace{1.0em \@plus\p@}%
  3225. %    \end{macrocode}
  3226. %    The macro |\numberline| requires that the width of the box that
  3227. %    holds the part number is stored in \LaTeX's scratch register
  3228. %    |\@tempdima|. Therefore we put it there. We begin a group, and
  3229. %    change some of the paragraph parameters.
  3230. %    \begin{macrocode}
  3231.     \setlength\@tempdima{1.5em}%
  3232.     \begingroup
  3233.       \parindent \z@ \rightskip \@pnumwidth
  3234.       \parfillskip -\@pnumwidth
  3235. %    \end{macrocode}
  3236. %    Then we leave vertical mode and switch to a bold font.
  3237. %    \begin{macrocode}
  3238.       \leavevmode \bfseries
  3239. %    \end{macrocode}
  3240. %    Because we do not use |\numberline| here, we have do some fine
  3241. %    tuning `by hand', before we can set the entry. We discourage but
  3242. %    not disallow a pagebreak immediately after a chapter entry.
  3243. %    \begin{macrocode}
  3244.       \advance\leftskip\@tempdima
  3245.       \hskip -\leftskip
  3246.       #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
  3247.     \endgroup
  3248.   \fi}
  3249. %</article>
  3250. %    \end{macrocode}
  3251. %    In the report and book document classes the definition for
  3252. %    |\l@section| is much simpler.
  3253. %    \begin{macrocode}
  3254. %<*report|book>
  3255. \newcommand*{\l@section}      {\@dottedtocline{1}{1.5em}{2.3em}}
  3256. %</report|book>
  3257. %    \end{macrocode}
  3258. % \end{macro}
  3259. % \begin{macro}{\l@subsection}
  3260. % \begin{macro}{\l@subsubsection}
  3261. % \begin{macro}{\l@paragraph}
  3262. % \begin{macro}{\l@subparagraph}
  3263. %    All lower level entries are defined using the macro
  3264. %    |\@dottedtocline| (see above).
  3265. %    \begin{macrocode}
  3266. %<*article>
  3267. \newcommand*{\l@subsection}   {\@dottedtocline{2}{1.5em}{2.3em}}
  3268. \newcommand*{\l@subsubsection}{\@dottedtocline{3}{3.8em}{3.2em}}
  3269. \newcommand*{\l@paragraph}    {\@dottedtocline{4}{7.0em}{4.1em}}
  3270. \newcommand*{\l@subparagraph} {\@dottedtocline{5}{10em}{5em}}
  3271. %</article>
  3272. %<*report|book>
  3273. \newcommand*{\l@subsection}   {\@dottedtocline{2}{3.8em}{3.2em}}
  3274. \newcommand*{\l@subsubsection}{\@dottedtocline{3}{7.0em}{4.1em}}
  3275. \newcommand*{\l@paragraph}    {\@dottedtocline{4}{10em}{5em}}
  3276. \newcommand*{\l@subparagraph} {\@dottedtocline{5}{12em}{6em}}
  3277. %</report|book>
  3278. %    \end{macrocode}
  3279. % \end{macro}
  3280. % \end{macro}
  3281. % \end{macro}
  3282. % \end{macro}
  3283. % \subsubsection{List of figures}
  3284. % \begin{macro}{\listoffigures}
  3285. %    This macro is used to request that \LaTeX{} produces a list of
  3286. %    figures. It is very similar to |\tableofcontents|.
  3287. % \changes{v1.0g}{1993/12/09}{Moved the setting of
  3288. %                             \cmd\@restonecolfalse}
  3289. %    \begin{macrocode}
  3290. \newcommand{\listoffigures}{%
  3291. %<*report|book>
  3292.     \if@twocolumn
  3293.       \@restonecoltrue\onecolumn
  3294.     \else
  3295.       \@restonecolfalse
  3296.     \fi
  3297.     \chapter*{\listfigurename
  3298. %</report|book>
  3299. %<article>    \section*{\listfigurename
  3300.       \@mkboth{\uppercase{\listfigurename}}%
  3301.               {\uppercase{\listfigurename}}}%
  3302.     \@starttoc{lof}%
  3303. %<report|book>    \if@restonecol\twocolumn\fi
  3304.     }
  3305. %    \end{macrocode}
  3306. % \end{macro}
  3307. % \begin{macro}{\l@figure}
  3308. %    This macro produces an entry in the list of figures.
  3309. %    \begin{macrocode}
  3310. \newcommand*{\l@figure}{\@dottedtocline{1}{1.5em}{2.3em}}
  3311. %    \end{macrocode}
  3312. % \end{macro}
  3313. % \subsubsection{List of tables}
  3314. % \begin{macro}{\listoftables}
  3315. %    This macro is used to request that \LaTeX{} produces a list of
  3316. %    tables. It is very similar to |\tableofcontents|.
  3317. % \changes{v1.0g}{1993/12/09}{Moved the setting of
  3318. %                             \cmd\@restonecolfalse}
  3319. %    \begin{macrocode}
  3320. \newcommand{\listoftables}{%
  3321. %<*report|book>
  3322.     \if@twocolumn
  3323.       \@restonecoltrue\onecolumn
  3324.     \else
  3325.       \@restonecolfalse
  3326.     \fi
  3327.     \chapter*{\listtablename
  3328. %</report|book>
  3329. %<article>    \section*{\listtablename
  3330.       \@mkboth{\uppercase{\listtablename}}{\uppercase{\listtablename}}}%
  3331.     \@starttoc{lot}%
  3332. %<report|book>    \if@restonecol\twocolumn\fi
  3333.     }
  3334. %    \end{macrocode}
  3335. % \end{macro}
  3336. % \begin{macro}{\l@table}
  3337. %    This macro produces an entry in the list of tables.
  3338. %    \begin{macrocode}
  3339. \let\l@table\l@figure
  3340. %    \end{macrocode}
  3341. % \end{macro}
  3342. % \subsection{Bibliography}
  3343. % \begin{macro}{\bibindent}
  3344. %    The ``open'' bibliography format uses an indentation of
  3345. %    |\bibindent|.
  3346. %    \begin{macrocode}
  3347. \newdimen\bibindent
  3348. \bibindent=1.5em
  3349. %    \end{macrocode}
  3350. % \end{macro}
  3351. % \begin{environment}{thebibliography}
  3352. %    The `thebibliography' environment executes the following
  3353. %    commands:
  3354. %    |\renewcommand{\newblock}{\hskip.11em \@plus.33em \@minus.07em}|\\
  3355. %      --- Defines the ``closed'' format, where the blocks (major units
  3356. %      of information) of an entry run together.
  3357. %    |\sloppy|  --- Used because it's rather hard to do line breaks in
  3358. %      bibliographies,
  3359. %    |\sfcode`\.=1000\relax| ---
  3360. %      Causes a `.' (period) not to produce an end-of-sentence space.
  3361. %    The implementation of this environment is based on the generic
  3362. %    list environment. It uses the \Lcount{enumiv} counter internally
  3363. %    to generate the labels of the list.
  3364. %    When an empty `thebibliography' environment is found, a warning
  3365. %    is issued.
  3366. % \changes{v1.0i}{1993/12/19}{Corrected definition of thebibliography
  3367. %           for article}
  3368. %    \begin{macrocode}
  3369. \newenvironment{thebibliography}[1]
  3370. %<*article>
  3371.      {\section*{\refname
  3372.         \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}%
  3373. %</article>
  3374. %<*!article>
  3375.      {\chapter*{\bibname
  3376.         \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}%
  3377. %</!article>
  3378.       \list{\@biblabel{\arabic{enumiv}}}%
  3379.            {\settowidth\labelwidth{\@biblabel{#1}}%
  3380.             \leftmargin\labelwidth
  3381.             \advance\leftmargin\labelsep
  3382.             \if@openbib
  3383.               \advance\leftmargin\bibindent
  3384.               \itemindent -\bibindent
  3385.               \listparindent \itemindent
  3386.               \parsep \z@
  3387.             \fi
  3388.             \usecounter{enumiv}%
  3389.             \let\p@enumiv\@empty
  3390.             \renewcommand{\theenumiv}{\arabic{enumiv}}}%
  3391.       \if@openbib
  3392.         \renewcommand{\newblock}{\par}
  3393.       \else
  3394.         \renewcommand{\newblock}{\hskip .11em \@plus.33em \@minus.07em}%
  3395.       \fi
  3396.       \sloppy\clubpenalty4000\widowpenalty4000%
  3397.       \sfcode`\.=\@m}
  3398.      {\def\@noitemerr
  3399.        {\@latex@warning{Empty `thebibliography' environment}}%
  3400.       \endlist}
  3401. %    \end{macrocode}
  3402. % \end{environment}
  3403. % \begin{macro}{\newblock}
  3404. %    A dummy definition of |\newblock|, just to let it exist.
  3405. %    \begin{macrocode}
  3406. \newcommand{\newblock}{}
  3407. %    \end{macrocode}
  3408. % \end{macro}
  3409. % \begin{macro}{\@biblabel}
  3410. %    The label for a |\bibitem[...]| command is produced by this
  3411. %    macro. The default from \file{latex.dtx} is used.
  3412. %    \begin{macrocode}
  3413. % \renewcommand*{\@biblabel}[1]{[#1]\hfill}
  3414. %    \end{macrocode}
  3415. % \end{macro}
  3416. % \begin{macro}{\@cite}
  3417. %    The output of the |\cite| command is produced by this macro. The
  3418. %    default from \file{latex.dtx} is used.
  3419. %    \begin{macrocode}
  3420. % \renewcommand*{\@cite}[1]{[#1]}
  3421. %    \end{macrocode}
  3422. % \end{macro}
  3423. %  \subsection{The index}
  3424. % \begin{environment}{theindex}
  3425. %    The environment `theindex' can be used for indices. It makes an
  3426. %    index with two columns, with each entry a separate paragraph. At
  3427. %    the user level the commands |\item|, |\subitem| and |\subsubitem|
  3428. %    are used to produce index entries of various levels. When a new
  3429. %    letter of the alphabet is encountered an amount of |\indexspace|
  3430. %    white space can be added.
  3431. % \changes{v1.0g}{1993/12/09}{Moved the setting of
  3432. %                             \cmd\@restonecoltrue}
  3433. %    \begin{macrocode}
  3434. \newenvironment{theindex}
  3435.                {\if@twocolumn
  3436.                   \@restonecolfalse
  3437.                 \else
  3438.                   \@restonecoltrue
  3439.                 \fi
  3440.                 \columnseprule \z@
  3441.                 \columnsep 35\p@
  3442. %<article>                \twocolumn[\section*{\indexname}]%
  3443. %<!article>                \twocolumn[\@makeschapterhead{\indexname}]%
  3444.                 \@mkboth{\uppercase{\indexname}}%
  3445.                         {\uppercase{\indexname}}%
  3446.                 \thispagestyle{plain}\parindent\z@
  3447.                 \parskip\z@ \@plus .3\p@\relax
  3448.                 \let\item\@idxitem}
  3449. %    \end{macrocode}
  3450. %    When the document continues after the index and it was a one
  3451. %    column document we have to switch back to one column after the
  3452. %    index.
  3453. %    \begin{macrocode}
  3454.                {\if@restonecol\onecolumn\else\clearpage\fi}
  3455. %    \end{macrocode}
  3456. % \end{environment}
  3457. % \begin{macro}{\@idxitem}
  3458. % \begin{macro}{\subitem}
  3459. % \begin{macro}{\subsubitem}
  3460. %    Thsee macros are used to format the entries in the index. ^^AA ???
  3461. %    \begin{macrocode}
  3462. \newcommand{\@idxitem}  {\par\hangindent 40\p@}
  3463. \newcommand{\subitem}   {\par\hangindent 40\p@ \hspace*{20\p@}}
  3464. \newcommand{\subsubitem}{\par\hangindent 40\p@ \hspace*{30\p@}}
  3465. %    \end{macrocode}
  3466. % \end{macro}
  3467. % \end{macro}
  3468. % \end{macro}
  3469. % \begin{macro}{\indexspace}
  3470. %    The amount of white space that is inserted between `letter
  3471. %    blocks' in the index.
  3472. %    \begin{macrocode}
  3473. \newcommand{\indexspace}{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
  3474. %    \end{macrocode}
  3475. % \end{macro}
  3476. % \subsection{Footnotes}
  3477. % \begin{macro}{\footnoterule}
  3478. %    Usually, footnotes are separated from the main body of the text
  3479. %    by a small rule. This rule is drawn by the macro |\footnoterule|.
  3480. %    We have to make sure that the rule takes no vertical space (see
  3481. %    \file{plain.tex}) so we compensate for the natural heigth of the
  3482. %    rule of 0.4pt by adding the right amount of vertical skip.
  3483. %    To prevent the rule from colliding with the footnote we first add
  3484. %    a little negative vertical skip, then we put the rule and make
  3485. %    sure we end up at the same point where we begun this operation.
  3486. %    \begin{macrocode}
  3487. \renewcommand{\footnoterule}{%
  3488.   \kern-3\p@
  3489.   \hrule width .4\columnwidth
  3490.   \kern 2.6\p@}
  3491. %    \end{macrocode}
  3492. % \end{macro}
  3493. % \begin{macro}{\c@footnote}
  3494. %    Footnotes are numbered within chapters in the report and book
  3495. %    document styles.
  3496. %    \begin{macrocode}
  3497. % \newcounter{footnote}
  3498. %<!article>\@addtoreset{footnote}{chapter}
  3499. %    \end{macrocode}
  3500. % \end{macro}
  3501. % \begin{macro}{\@makefntext}
  3502. %    The footnote mechanism of \LaTeX{} calls the macro |\@makefntext|
  3503. %    to produce the actual footnote. The macro gets the text of the
  3504. %    footnote as its argument and should use |\@thefnmark| as the mark
  3505. %    of the footnote. The macro |\@makefntext|is called when
  3506. %    effectively inside a |\parbox| of width |\columnwidth| (i.e.,
  3507. %    with |\hsize| = |\columnwidth|).
  3508. %   An example of what can be achieved is given by the following piece
  3509. %   of \TeX\ code.
  3510. % \begin{verbatim}
  3511. %          \long\def\@makefntext#1{%
  3512. %             \@setpar{\@@par
  3513. %                      \@tempdima = \hsize
  3514. %                      \advance\@tempdima-10pt
  3515. %                      \parshape \@ne 10pt \@tempdima}%
  3516. %             \par
  3517. %             \parindent 1em\noindent
  3518. %             \hbox to \z@{\hss\@makefnmark}#1}
  3519. % \end{verbatim}
  3520. %    The effect of this definition is that all lines of the footnote
  3521. %    are indented by 10pt, while the first line of a new paragraph is
  3522. %    indented by 1em. To change these dimensions, just substitute the
  3523. %    desired value for `10pt' (in both places) or `1em'.  The mark is
  3524. %    flushright against the footnote.
  3525. %    In these document classes we use a simpler macro, in which the
  3526. %    footnote text is set like an ordinary text paragraph, with no
  3527. %    indentation except on the first line of a paragraph, and the
  3528. %    first line of the footnote. Thus, all the macro must do is set
  3529. %    |\parindent| to the appropriate value for succeeding paragraphs
  3530. %    and put the proper indentation before the mark.
  3531. % \changes{v1.1a}{1994/03/13}{Use `@makefnmark to generate footnote
  3532. %                            marker}
  3533. %    \begin{macrocode}
  3534. \long\def\@makefntext#1{%
  3535.     \parindent 1em%
  3536.     \noindent
  3537.     \hbox to 1.8em{\hss\@makefnmark}#1}
  3538. %    \end{macrocode}
  3539. % \end{macro}
  3540. % \begin{macro}{\@makefnmark}
  3541. %    The footnote markers that are printed in the text to point to the
  3542. %    footnotes should be produced by the macro |\@makefnmark|. We use
  3543. %    the default definition for it.
  3544. %    \begin{macrocode}
  3545. %\def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}}
  3546. %    \end{macrocode}
  3547. % \end{macro}
  3548. % \section{Initialization}
  3549. % \subsection{Words}
  3550. % \begin{macro}{\contentsname}
  3551. % \begin{macro}{\listfigurename}
  3552. % \begin{macro}{\listtablename}
  3553. % \begin{macro}{\refname}
  3554. % \begin{macro}{\bibname}
  3555. % \begin{macro}{\indexname}
  3556. % \begin{macro}{\figurename}
  3557. % \begin{macro}{\tablename}
  3558. % \begin{macro}{\partname}
  3559. % \begin{macro}{\chaptername}
  3560. % \begin{macro}{\appendixname}
  3561. % \begin{macro}{\abstractname}
  3562. % This document class is for documents prepared in the English language.
  3563. % To prepare a version for another language, various English words must
  3564. % be replaced.  All the English words that require replacement are
  3565. % defined below in command names.
  3566. %    \begin{macrocode}
  3567. \newcommand{\contentsname}{Contents}
  3568. \newcommand{\listfigurename}{List of Figures}
  3569. \newcommand{\listtablename}{List of Tables}
  3570. %<article>\newcommand{\refname}{References}
  3571. %<report|book>\newcommand{\bibname}{Bibliography}
  3572. \newcommand{\indexname}{Index}
  3573. \newcommand{\figurename}{Figure}
  3574. \newcommand{\tablename}{Table}
  3575. \newcommand{\partname}{Part}
  3576. %<report|book>\newcommand{\chaptername}{Chapter}
  3577. \newcommand{\appendixname}{Appendix}
  3578. %<!book>\newcommand{\abstractname}{Abstract}
  3579. %    \end{macrocode}
  3580. % \end{macro}
  3581. % \end{macro}
  3582. % \end{macro}
  3583. % \end{macro}
  3584. % \end{macro}
  3585. % \end{macro}
  3586. % \end{macro}
  3587. % \end{macro}
  3588. % \end{macro}
  3589. % \end{macro}
  3590. % \end{macro}
  3591. % \end{macro}
  3592. % \subsection{Date}
  3593. % \begin{macro}{\today}
  3594. %    This macro uses the \TeX\ primitives |\month|, |\day| and |\year|
  3595. %    to provide the date of the \LaTeX-run.
  3596. %    \begin{macrocode}
  3597. \newcommand{\today}{\ifcase\month\or
  3598.   January\or February\or March\or April\or May\or June\or
  3599.   July\or August\or September\or October\or November\or December\fi
  3600.   \space\number\day, \number\year}
  3601. %    \end{macrocode}
  3602. % \end{macro}
  3603. % \subsection{Two column mode}
  3604. % \begin{macro}{\columnsep}
  3605. %    This gives the distance between two columns in two column mode.
  3606. %    \begin{macrocode}
  3607. \setlength\columnsep{10\p@}
  3608. %    \end{macrocode}
  3609. % \end{macro}
  3610. % \begin{macro}{\columnseprule}
  3611. %    This gives the width of the rule between two columns in two
  3612. %    column mode. We have no visible rule.
  3613. %    \begin{macrocode}
  3614. \setlength\columnseprule{0\p@}
  3615. %    \end{macrocode}
  3616. % \end{macro}
  3617. % \subsection{The page style}
  3618. %    We have \pstyle{plain} pages in the document classes article and
  3619. %    report unless the user specified otherwise. In the `book'
  3620. %    document class we use the page style \pstyle{headings} by
  3621. %    default. We use arabic pagenumbers.
  3622. %    \begin{macrocode}
  3623. %<!book>\pagestyle{plain}
  3624. %<book>\pagestyle{headings}
  3625. \pagenumbering{arabic}      % Arabic page numbers
  3626. %    \end{macrocode}
  3627. % \subsection{Single or double sided printing}
  3628. % \changes{v1.2v}{1994/11/10}{removed typo}
  3629. %    When the \Lopt{twoside} option wasn't specified, we don't try to
  3630. %    make each page as long as all the others.
  3631. %    \begin{macrocode}
  3632. \if@twoside
  3633. \else
  3634.   \raggedbottom
  3635. %    \end{macrocode}
  3636. %    When the \Lopt{twocolumn} option was specified we call
  3637. %    |\twocolumn| to activate this mode. We try to make each column as
  3638. %    long as the others, but call |sloppy| to make our life easier.
  3639. %    \begin{macrocode}
  3640. \if@twocolumn
  3641.   \twocolumn
  3642.   \sloppy
  3643.   \flushbottom
  3644. %    \end{macrocode}
  3645. %    Normally we call |\onecolumn| to initiate typesetting in one
  3646. %    column.
  3647. %    \begin{macrocode}
  3648. \else
  3649.   \onecolumn
  3650. %</article|report|book>
  3651. %    \end{macrocode}
  3652. % \section{External options to the standard document classes}
  3653. % \subsection{Left equation numbering}
  3654. %  \begin{macro}{\@eqnnum}
  3655. %    To put the equation number on the left side of an equation we
  3656. %    have to use a little trick. The number is shifted |\displaywidth|
  3657. %    to the left inside a box of (approximately) zero width. This
  3658. %    fails when the quation is too wide, the equation number than may
  3659. %    overprint the equation itself.
  3660. %    \begin{macrocode}
  3661. %<*leqno>
  3662. \renewcommand{\@eqnnum}{\hbox to .01\p@{}%
  3663.                       \rlap{\reset@font\rmfamily
  3664.                         \hskip -\displaywidth(\theequation)}}
  3665. %</leqno>
  3666. %    \end{macrocode}
  3667. %  \end{macro}
  3668. % \subsection{Flush left equations}
  3669. %    To get the displayed math environments to print the contents
  3670. %    flush left (with an indentation) we have to redefine all of
  3671. %    \LaTeXe's displayed math environments. 
  3672. %  \begin{macro}{\mathindent}
  3673. %    The amount of indentation of the equations is stored in a register.
  3674. %    \begin{macrocode}
  3675. %<*fleqn>
  3676. \newdimen\mathindent
  3677. %    \end{macrocode}
  3678. %    The setting of |\mathindent| has to be deferred until the class
  3679. %    file has been processed, because |\leftmargini| is still 0pt
  3680. %    wide at the moment \file{fleqn.clo} is read in.
  3681. % \changes{v1.0n}{1994/01/19}{Deferred setting of \cmd\mathindent}
  3682. % \changes{v1.2t}{1994/06/22}{Set \cs{mathindent} at the end of the
  3683. %    class instead of at begin document}
  3684. %    \begin{macrocode}
  3685. \AtEndOfClass{\mathindent\leftmargini}
  3686. %    \end{macrocode}
  3687. % \end{macro}
  3688. %  \begin{macro}{\[}
  3689. %    Begin display math;
  3690. %    \begin{macrocode}
  3691. \renewcommand{\[}{\relax
  3692.                  \ifmmode\@badmath
  3693.                  \else
  3694.                    \begin{trivlist}%
  3695.                      \@beginparpenalty\predisplaypenalty
  3696.                      \@endparpenalty\postdisplaypenalty
  3697.                      \item[]\leavevmode
  3698.                      \hbox to\linewidth\bgroup $\m@th\displaystyle %$
  3699.                        \hskip\mathindent\bgroup
  3700.                  \fi}
  3701. %    \end{macrocode}
  3702. % \end{macro}
  3703. %  \begin{macro}{\]}
  3704. %    end display math;
  3705. %    \begin{macrocode}
  3706. \renewcommand{\]}{\relax
  3707.                  \ifmmode
  3708.                        \egroup $\hfil% $
  3709.                      \egroup
  3710.                    \end{trivlist}%
  3711.                  \else \@badmath
  3712.                  \fi}
  3713. %    \end{macrocode}
  3714. % \end{macro}
  3715. %  \begin{environment}{equation}
  3716. %    The \textsf{equation} environment
  3717. %    \begin{macrocode}
  3718. \renewenvironment{equation}%
  3719.     {\@beginparpenalty\predisplaypenalty
  3720.      \@endparpenalty\postdisplaypenalty
  3721.      \refstepcounter{equation}%
  3722.      \trivlist \item[]\leavevmode
  3723.        \hbox to\linewidth\bgroup $\m@th% $
  3724.          \displaystyle
  3725.          \hskip\mathindent}%
  3726.         {$\hfil % $
  3727.          \displaywidth\linewidth\hbox{\@eqnnum}%
  3728.        \egroup
  3729.      \endtrivlist}
  3730. %    \end{macrocode}
  3731. % \end{environment}
  3732. % \begin{environment}{eqnarray}
  3733. %    The \textsf{eqnarray} environment
  3734. %    \begin{macrocode}
  3735. \renewenvironment{eqnarray}{%
  3736.     \stepcounter{equation}%
  3737.     \def\@currentlabel{\p@equation\theequation}%
  3738.     \global\@eqnswtrue\m@th
  3739.     \global\@eqcnt\z@
  3740.     \tabskip\mathindent
  3741.     \let\\=\@eqncr
  3742.     \setlength{\abovedisplayskip}{\topsep}%
  3743.     \ifvmode
  3744.       \addtolength{\abovedisplayskip}{\partopsep}%
  3745.     \fi
  3746. %    \end{macrocode}
  3747. %    When the documentclass uses a non-zero |\parskip| setting the
  3748. %    |\topsep| might have a negative value to compensate for
  3749. %    that. Therefor we add |\parskip| to |\abovedisplayskip|.
  3750. % \changes{v1.2v}{1994/11/10}{Added value of \cs{parskip} to
  3751. %    \cs{abovedisplayskip} to compensate for negative \sc{topsep}}
  3752. %    \begin{macrocode}
  3753.     \addtolength{\abovedisplayskip}{\parskip}%
  3754.     \setlength{\belowdisplayskip}{\abovedisplayskip}%
  3755.     \setlength{\belowdisplayshortskip}{\abovedisplayskip}%
  3756.     \setlength{\abovedisplayshortskip}{\abovedisplayskip}%
  3757.     $$\everycr{}\halign to\linewidth% $$
  3758.     \bgroup
  3759.       \hskip\@centering
  3760.       $\displaystyle\tabskip\z@skip{##}$\@eqnsel&%
  3761.       \global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}$\hfil&%
  3762.       \global\@eqcnt\tw@ \hskip \tw@\arraycolsep
  3763.         $\displaystyle{##}$\hfil \tabskip\@centering&%
  3764.       \global\@eqcnt\thr@@
  3765.         \hbox to \z@\bgroup\hss##\egroup\tabskip\z@skip\cr}%
  3766.       {\@@eqncr
  3767.     \egroup
  3768.     \global\advance\c@equation\m@ne$$% $$
  3769.     \global\@ignoretrue
  3770.     }
  3771. %</fleqn>
  3772. %    \end{macrocode}
  3773. % \end{environment}
  3774. % \Finale
  3775. \endinput
  3776.